fixed syntax error (huh?) and added framerate limit