fix popstates