fix a bug related to the timer