Fixed a runtime error and increased the FPS on high speed devices