Fixed registration system; now raises an error if the name is already registered