modified Model.php