ajusting speed to frame rate