added model validation and updates