fix popstate; detach to method