model validation logic