add onBeforeTransition to allow parameter passing between pages