added a validation on model creation