bug fix for model generation