error in the generate model code