support pushstate after leaving document