Better back button behaviour when viewing modals