fixed code generator