works with a correct framerate