before reset