added some model validation