```\n   function _setTemplate(\n        string memory templateName,\n        uint256 templateVersion,\n        address implementationAddress\n    ) internal {\n// rest of code\n\n        if (latestImplementation[templateName] == address(0)) { /****add other version, _templateNames will duplicate ****/\n            _templateNames.push(templateName);\n        }\n\n        if (templateVersion > latestVersion[templateName]) {\n            latestVersion[templateName] = templateVersion;\n            latestImplementation[templateName] = implementationAddress; /****templateVersion==0 ,  don't set ****/\n        }\n\n    }\n```\n