Add a function to check if there are validation errors on models.