bug fix in model