added global reset function