Added a before transition event and the ability to stop listening