Feature/add onbeforenavigation