Change back button behaviour when an action is done