adding reset function