fixed the timer bug