fixed back button functionality