fixed reset function error