updated hashchange event handling to pass tests