better popstate for safari