make the timer logic slightly better