fix generate model bug