fixing double generated code