added beforehashchange event