add model validation in sample