fix the back button behavior