Add hash change event listener to support browser back button.