fixed the generated code