use popstate instead of relying on hash