added validations to ClassDefinition