fix model generated code