reset function error fixed