fix history to update the page when back button is pressed