add validation for entities