Fixed bug that caused timer to execute many times to fast