Fix timer bug