fix bugs related to pushState