fix timer bug