changed code for back button