add pushstate / popstate handler