throw an error when a discriminator is added with the same name