Adding model validation.