fix code generation