fix framerate timing bug