Trying to fix the logic bugs in the timer