bugfix for infinite loop in Model