Improved frameRate timer and fixed state setting