change generate_code repair a problem