add back button / popstate handling