added a validation to the TypeField