Correct a bug about not clearing an interval