Fixes popstate issue causing window.reload