fix generated code