added trigger before popstate change