Added framerate controlling