fixed an error where new reg class would repeat itself