add a reset function.