BaseModel.php modified