fixed bug in frame counter.