Fixed the toggle loop problem.