handling main page back button