bug fix in buildmodel
output is right