fix behaviour on back button press