added model validation