small fix to popstate