Fix bug for stopping timer