change onhashchange to addEventListener