make sure modal cleanup happens even if the user navigates to a different page