small fix in reset function