fixing generated code