fixed code generation