Addition of beforePageTransition event