fixed framerate bug