Fix back button navigation with onhashchange