Add onpopstate listener