Fix pushstate logic