The lines that clear the `isTransitioning` and `removeEventListener` probably need to happen before this yeah?