fixed code generation error