applying model validation.