Updated reset function