fixed framerate bugs, keyboard control issue