Fix a bug that timer cannot stop, it is introduced by fixing the previous bug.