clean up reset function