Fix the bug of endless timer