Added error handling for when you hit back button to login