fix bug in Model