Fix locationReplace with delayed pushState