Fixed flickering on hashchange events