diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.spec.ts
index 69d530d..5cf6e96 100644
--- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.spec.ts
+++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.spec.ts
@@ -2586,6 +2586,7 @@
       {
         "action": 'None',
         "modelId": "afacccf6-397d-45d6-b5ae-94c39734b168",
+        "modelInvariantId": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8",
         "modelCustomizationId": "b3c76f73-eeb5-4fb6-9d31-72a889f1811c",
         "modelUniqueId": "b3c76f73-eeb5-4fb6-9d31-72a889f1811c",
         "missingData": true,
@@ -2638,6 +2639,7 @@
           "parentType": 'VNF',
           "action": 'None',
           "modelId": "f8360508-3f17-4414-a2ed-6bc71161e8db",
+          "modelInvariantId": "b34833bb-6aa9-4ad6-a831-70b06367a091",
           "modelCustomizationId": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3",
           "modelUniqueId": "a55961b2-2065-4ab0-a5b7-2fcee1c227e3",
           "missingData": true,
@@ -2741,6 +2743,7 @@
         "parentType": '',
         "action": 'None',
         "modelId": "ddc3f20c-08b5-40fd-af72-c6d14636b986",
+        "modelInvariantId": "379f816b-a7aa-422f-be30-17114ff50b7c",
         "modelCustomizationId": "94fdd893-4a36-4d70-b16a-ec29c54c184f",
         "modelUniqueId": "94fdd893-4a36-4d70-b16a-ec29c54c184f",
         "missingData": false,
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts
index 2ff729d..8905d41 100644
--- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts
+++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.spec.ts
@@ -340,13 +340,21 @@
     });
 
 
-  const isDiffCustomizationUuidProvider = [
-    ['currentVfModule customizationUuid and customizationUuid vfModuleHierarchy are diff' ,true,  'mDNS 01222020 0', 'mdns012220200..Mdns01222020..base_dns..module-0', '82160e6e-d9c4-45ef-bd19-01573ab11b61'],
-    ['currentVfModule customizationUuid and customizationUuid vfModuleHierarchy are same' , false, 'mDNS 01222020 0', 'mdns012220200..Mdns01222020..base_dns..module-0', 'c9b32003-febc-44e0-a97f-7630fa7fa4a0'],
-    ['vnfHierarchy is not part of the current model' , true, 'VNF_NOT_PART_OF_THE_MODEL', 'mdns012220200..Mdns01222020..base_dns..module-0',  'c9b32003-febc-44e0-a97f-7630fa7fa4a0'],
-    ['vfModuleHierarchy is not part of the current model', true, 'mDNS 01222020 1', 'VFM_NOT_PART_OF_THE_MODEL',  'c9b32003-febc-44e0-a97f-7630fa7fa4a0']];
+  const isVfmoduleAlmostPartOfModelOnlyCustomizationUuidDifferProvider = [
+    ['node is part of model, but vfmodule diff by customization',
+      true, 'mDNS 01222020 0', '9fdc68e9-9f53-431c-b8a2-7e337b9a0d0a', '82160e6e-d9c4-45ef-bd19-01573ab11b61'],
 
-  each(isDiffCustomizationUuidProvider).test('isDiffCustomizationUuid: when  %s should return %s', (description, expected, vnfModelName, vfModuleModelName, customizationUuid) => {
+    ['vnf model-name not found',
+      false, 'mDNS 01222020 1', '9fdc68e9-9f53-431c-b8a2-7e337b9a0d0a', '82160e6e-d9c4-45ef-bd19-01573ab11b61'],
+
+    ['vfmodule invariant-id not found',
+      false, 'mDNS 01222020 0', 'wrong invariant-id', '82160e6e-d9c4-45ef-bd19-01573ab11b61'],
+
+    ['vfmodule customization-id match',
+      false, 'mDNS 01222020 0', '9fdc68e9-9f53-431c-b8a2-7e337b9a0d0a', 'c9b32003-febc-44e0-a97f-7630fa7fa4a0'],
+  ];
+
+  each(isVfmoduleAlmostPartOfModelOnlyCustomizationUuidDifferProvider).test('isVfmoduleAlmostPartOfModelOnlyCustomizationUuidDiffer: when  %s should return %s', (description, expected, vnfModelName, invariantUuid, customizationUuid) => {
     const serviceModelId : string = 'a243da28-c11e-45a8-9f26-0284a9a789bc';
     spyOn(store, 'getState').and.returnValue({
       service : {
@@ -355,7 +363,8 @@
             vnfs : {
               [vnfModelName] : {
                 vfModules : {
-                  [vfModuleModelName] : {
+                  vfModuleModelName : {
+                    invariantUuid : invariantUuid,
                     customizationUuid : customizationUuid
                   }
                 }
@@ -368,8 +377,9 @@
 
     const node = <any>{
       data:{
+        modelInvariantId : '9fdc68e9-9f53-431c-b8a2-7e337b9a0d0a',
         modelCustomizationId : 'c9b32003-febc-44e0-a97f-7630fa7fa4a0',
-        modelName : vfModuleModelName
+        modelName : 'vfModuleModelName'
       },
       parent : {
         data : {
@@ -378,7 +388,7 @@
       }
     };
 
-    const isDiffCustomizationUuidResponse : boolean = service.isDiffCustomizationUuid(node, serviceModelId);
+    const isDiffCustomizationUuidResponse : boolean = service.isVfmoduleAlmostPartOfModelOnlyCustomizationUuidDiffer(node, serviceModelId);
     expect(isDiffCustomizationUuidResponse).toEqual(expected);
   });
 
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts
index 964e120..9e7a021 100644
--- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts
+++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts
@@ -53,8 +53,18 @@
       : (nodeInstance.modelInfo.modelCustomizationId || nodeInstance.modelInfo.modelInvariantId);
   };
 
-  modelUniqueNameOrId = (instance): string =>
-    instance.originalName ? instance.originalName : this.modelUniqueId(instance);
+  modelUniqueNameOrId = (instance): string => {
+    if (_.isNil(instance)) {
+      return null;
+    }
+
+    const innerInstance = _.find(instance) || {};
+
+    return instance.originalName
+      || this.modelUniqueId(instance)
+      || innerInstance.originalName
+      || this.modelUniqueId(innerInstance);
+  };
 
   /**
    * Finds a model inside a full service model
@@ -207,7 +217,7 @@
    ****************************************************/
   shouldShowUpgrade(node, serviceModelId): boolean {
     if (FeatureFlagsService.getFlagState(Features.FLAG_FLASH_REPLACE_VF_MODULE, this._store) &&
-      (this.isThereAnUpdatedLatestVersion(serviceModelId)) || this.isDiffCustomizationUuid(node, serviceModelId)) {
+      (this.isThereAnUpdatedLatestVersion(serviceModelId)) || this.isVfmoduleAlmostPartOfModelOnlyCustomizationUuidDiffer(node, serviceModelId)) {
       return this.shouldShowButtonGeneric(node, VNFMethods.UPGRADE, serviceModelId);
     }
     else {
@@ -216,18 +226,43 @@
   }
 
 
-  isDiffCustomizationUuid(node, serviceModelId) : boolean {
-    const vfModuleServiceHierarchy =  this.getVfModuleHierarchyThroughParentModelName(node, serviceModelId);
-    if(_.isNil(vfModuleServiceHierarchy)){
-      return true;
+  isVfmoduleAlmostPartOfModelOnlyCustomizationUuidDiffer(vfModuleNode, serviceModelId) : boolean {
+    /*
+    for `true`, should all:
+    1. parent vnf found by model-mane
+    2. vfmodule found by invariant
+    3. vfmodule diff by customization
+     */
+
+    if (_.isNil(vfModuleNode.data)) {
+      return false;
     }
-    return node.data && !_.isNil(vfModuleServiceHierarchy) && vfModuleServiceHierarchy.customizationUuid  && (vfModuleServiceHierarchy.customizationUuid !== node.data.modelCustomizationId);
+
+    const vnfHierarchy = this.getParentVnfHierarchy(vfModuleNode, serviceModelId);
+    if (_.isNil(vnfHierarchy)) {
+      return false;
+    }
+
+    const vfModuleHierarchyByInvariantId =  this.getVfModuleHFromVnfHierarchyByInvariantId(vfModuleNode, vnfHierarchy);
+    if(_.isNil(vfModuleHierarchyByInvariantId)){
+      return false;
+    }
+
+    return vfModuleHierarchyByInvariantId.customizationUuid
+      && (vfModuleHierarchyByInvariantId.customizationUuid !== vfModuleNode.data.modelCustomizationId);
   }
 
-  getVfModuleHierarchyThroughParentModelName(node, serviceModelId) {
-    if(node.parent && node.parent.data && node.data){
-      const vnfHierarchy =  this._store.getState().service.serviceHierarchy[serviceModelId].vnfs[node.parent.data.modelName];
-      return vnfHierarchy ? vnfHierarchy.vfModules[node.data.modelName] : null;
+  getParentVnfHierarchy(vfModuleNode, serviceModelId) {
+    if (vfModuleNode.parent && vfModuleNode.parent.data) {
+      return this._store.getState().service.serviceHierarchy[serviceModelId].vnfs[vfModuleNode.parent.data.modelName];
+    } else {
+      return null;
+    }
+  }
+
+  getVfModuleHFromVnfHierarchyByInvariantId(vfModuleNode, parentVnfHierarchy) {
+    if(vfModuleNode.data.modelInvariantId && parentVnfHierarchy && parentVnfHierarchy.vfModules){
+      return _.find(parentVnfHierarchy.vfModules, o => o.invariantUuid === vfModuleNode.data.modelInvariantId);
     }
     return null;
   }
