logic to log the validation error is added to both models.