diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.ts
index f442e15..b1a67a5 100644
--- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.ts
+++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.ts
@@ -351,7 +351,7 @@
       },
       delete: {
         method: (node, serviceModelId) => {
-          this._store.dispatch(deleteActionVfModuleInstance(node.data.dynamicModelName, node.parent.data.vnfStoreKey, serviceModelId))
+          this._store.dispatch(deleteActionVfModuleInstance(node.data.dynamicModelName, node.parent.data.vnfStoreKey, serviceModelId, node.data.modelName))
         },
         visible: (node) => this._sharedTreeService.shouldShowDelete(node, serviceModelId),
         enable: (node) => this._sharedTreeService.shouldShowDelete(node, serviceModelId)
diff --git a/vid-webpack-master/src/app/shared/storeUtil/utils/vfModule/vfModule.actions.ts b/vid-webpack-master/src/app/shared/storeUtil/utils/vfModule/vfModule.actions.ts
index 1b80452..ac26ba9 100644
--- a/vid-webpack-master/src/app/shared/storeUtil/utils/vfModule/vfModule.actions.ts
+++ b/vid-webpack-master/src/app/shared/storeUtil/utils/vfModule/vfModule.actions.ts
@@ -49,6 +49,7 @@
   dynamicModelName: string;
   vnfStoreKey : string;
   serviceId?: string;
+  vfModuleModelName: string;
 }
 
 export interface UpgradeVfModuleInstanceAction extends Action {
@@ -115,11 +116,12 @@
   vnfStoreKey : vnfStoreKey
 });
 
-export const deleteActionVfModuleInstance: ActionCreator<DeleteActionVfModuleInstanceAction> = (dynamicModelName, vnfStoreKey, serviceId) => ({
+export const deleteActionVfModuleInstance: ActionCreator<DeleteActionVfModuleInstanceAction> = (dynamicModelName, vnfStoreKey, serviceId, vfModuleModelName) => ({
   type: VfModuleActions.DELETE_ACTION_VF_MODULE_INSTANCE,
   dynamicModelName: dynamicModelName,
   vnfStoreKey : vnfStoreKey,
-  serviceId: serviceId
+  serviceId: serviceId,
+  vfModuleModelName
 });
 
 export const undoDeleteVfModuleInstance: ActionCreator<UndoDeleteActionVfModuleInstanceAction> = (dynamicModelName, vnfStoreKey, serviceId) => ({
diff --git a/vid-webpack-master/src/app/shared/storeUtil/utils/vfModule/vfModule.reducers.spec.ts b/vid-webpack-master/src/app/shared/storeUtil/utils/vfModule/vfModule.reducers.spec.ts
index 9ef440f..9bbcf46 100644
--- a/vid-webpack-master/src/app/shared/storeUtil/utils/vfModule/vfModule.reducers.spec.ts
+++ b/vid-webpack-master/src/app/shared/storeUtil/utils/vfModule/vfModule.reducers.spec.ts
@@ -1,15 +1,18 @@
 import {
   CreateVFModuleInstanceAction,
-  DeleteActionVfModuleInstanceAction, DeleteVFModuleField,
+  DeleteActionVfModuleInstanceAction,
+  DeleteVFModuleField,
   DeleteVfModuleInstanceAction,
   UndoDeleteActionVfModuleInstanceAction,
-  UpdateVFModluePosition, UpdateVFModuleField,
+  UpdateVFModluePosition,
+  UpdateVFModuleField,
   UpgradeVfModuleInstanceAction,
   VfModuleActions
 } from "./vfModule.actions";
 import {vfModuleReducer} from "./vfModule.reducers";
 import {VfModuleInstance} from "../../../models/vfModuleInstance";
 import {ServiceInstanceActions} from "../../../models/serviceInstanceActions";
+import each from "jest-each";
 
 
 describe('vfModuleReducer', () => {
@@ -114,12 +117,12 @@
         dynamicModelName: 'dynamicModelName1',
         vnfStoreKey: 'vnfStoreKey',
         serviceId: 'serviceModelId',
-        modelName: 'modelName',
+        modelName: 'vfModuleModelName',
         fieldName: newFieldName,
         fieldValue: newFieldValue
       });
 
-    let vfModule = newState.serviceInstance['serviceModelId'].vnfs['vnfStoreKey'].vfModules['modelName']['dynamicModelName1'];
+    let vfModule = newState.serviceInstance['serviceModelId'].vnfs['vnfStoreKey'].vfModules['vfModuleModelName']['dynamicModelName1'];
 
     expect(vfModule[newFieldName]).toEqual(newFieldValue);
   });
@@ -200,18 +203,22 @@
   expect(vfModule.position).toEqual(1);
 });
 
-test('#DELETE_ACTION_VF_MODULE_INSTANCE', () => {
-  let vfModule = vfModuleReducer(<any>getReduxState(), getDeleteActionVfModule())
-    .serviceInstance['serviceModelId'].vnfs['vnfStoreKey'].vfModules['modelName']['dynamicModelName1'];
+  each([
+    ['for the first vfModule', 'dynamicModelName1', true],
+    ['for the second vfModule', 'dynamicModelName2', true],
+  ]).
+test('#DELETE_ACTION_VF_MODULE_INSTANCE %s', (description, dynamicModelName: string, isMissingData: boolean) => {
+    let vfModule = vfModuleReducer(<any>getReduxState(), getDeleteActionVfModule(dynamicModelName))
+      .serviceInstance['serviceModelId'].vnfs['vnfStoreKey'].vfModules['vfModuleModelName'][dynamicModelName];
 
-  expect(vfModule).toBeDefined();
-  expect(vfModule.isMissingData).toBeTruthy();
-  expect(vfModule.action).toEqual(ServiceInstanceActions.None_Delete);
-});
+    expect(vfModule).toBeDefined();
+    expect(vfModule.isMissingData).toBeTruthy();
+    expect(vfModule.action).toEqual(ServiceInstanceActions.None_Delete);
+  });
 
 test('#DELETE_ACTION_VF_MODULE_INSTANCE set tenantId and lcpCloudRegion to VFM', () => {
-  let vfModule = vfModuleReducer(<any>getReduxState(), getDeleteActionVfModule())
-    .serviceInstance['serviceModelId'].vnfs['vnfStoreKey'].vfModules['modelName']['dynamicModelName1'];
+  let vfModule = vfModuleReducer(<any>getReduxState(), getDeleteActionVfModule('dynamicModelName1'))
+    .serviceInstance['serviceModelId'].vnfs['vnfStoreKey'].vfModules['vfModuleModelName']['dynamicModelName1'];
 
   expect(vfModule).toBeDefined();
   expect(vfModule.tenantId).toEqual('tenantId');
@@ -260,8 +267,8 @@
       dynamicModelName: 'dynamicModelName1',
       vnfStoreKey: 'vnfStoreKey',
       serviceId: 'serviceModelId',
-      modelName: 'modelName'
-    }).serviceInstance['serviceModelId'].vnfs['vnfStoreKey'].vfModules['modelName']['dynamicModelName1'];
+      modelName: 'vfModuleModelName'
+    }).serviceInstance['serviceModelId'].vnfs['vnfStoreKey'].vfModules['vfModuleModelName']['dynamicModelName1'];
 
   expect(vfModule.action).toEqual(ServiceInstanceActions.None_Upgrade);
 });
@@ -312,12 +319,15 @@
            tenantId: 'tenantId',
            lcpCloudRegionId: 'lcpCloudRegionId',
            vfModules: {
-             'modelName': {
+             'vfModuleModelName': {
                'dynamicModelName1': {
                  isMissingData: true,
                  action: 'None',
                },
-               'dynamicModelName2': {},
+               'dynamicModelName2': {
+                 action: 'None',
+                 isMissingData: true,
+               },
              }
            }
          }
@@ -327,12 +337,13 @@
  }
 }
 
-function getDeleteActionVfModule() {
+function getDeleteActionVfModule(dynamicModelName?: string) {
   return <DeleteActionVfModuleInstanceAction>{
     type: VfModuleActions.DELETE_ACTION_VF_MODULE_INSTANCE,
-    dynamicModelName: 'dynamicModelName1',
+    dynamicModelName: dynamicModelName,
     vnfStoreKey: 'vnfStoreKey',
-    serviceId: 'serviceModelId'
+    serviceId: 'serviceModelId',
+    vfModuleModelName: 'vfModuleModelName',
   }
 }
 });
diff --git a/vid-webpack-master/src/app/shared/storeUtil/utils/vfModule/vfModule.reducers.ts b/vid-webpack-master/src/app/shared/storeUtil/utils/vfModule/vfModule.reducers.ts
index 1ab275e..9c624b0 100644
--- a/vid-webpack-master/src/app/shared/storeUtil/utils/vfModule/vfModule.reducers.ts
+++ b/vid-webpack-master/src/app/shared/storeUtil/utils/vfModule/vfModule.reducers.ts
@@ -70,20 +70,17 @@
       return Object.assign({}, state);
     }
     case VfModuleActions.DELETE_ACTION_VF_MODULE_INSTANCE : {
+      let deleteAction = (<DeleteActionVfModuleInstanceAction>action);
       let newState = _.cloneDeep(state);
-      let vfModules = newState.serviceInstance[(<DeleteActionVfModuleInstanceAction>action).serviceId].vnfs[(<DeleteActionVfModuleInstanceAction>action).vnfStoreKey].vfModules;
+      let vfModule = newState.serviceInstance[deleteAction.serviceId].vnfs[deleteAction.vnfStoreKey]
+        .vfModules[deleteAction.vfModuleModelName][deleteAction.dynamicModelName];
+      let oldAction = vfModule.action;
+      if (oldAction === ServiceInstanceActions.None_Delete || oldAction === ServiceInstanceActions.Update_Delete) return newState;
+      newState.serviceInstance[deleteAction.serviceId].vnfs[deleteAction.vnfStoreKey]
+        .vfModules[deleteAction.vfModuleModelName][deleteAction.dynamicModelName].action = (oldAction + '_Delete') as ServiceInstanceActions;
+      setLcpCloudRegionIdAndTenantIdFromVnf(newState, deleteAction.serviceId, deleteAction.vnfStoreKey, deleteAction.vfModuleModelName, deleteAction.dynamicModelName);
+      updateIsMissingDataOnDeleteVFModule(newState, (<UndoDeleteActionVfModuleInstanceAction>action).serviceId, (<UndoDeleteActionVfModuleInstanceAction>action).vnfStoreKey, deleteAction.vfModuleModelName);
 
-      for(let key in vfModules){
-        let firstKey = Object.keys(vfModules[key])[0];
-        if(firstKey === (<DeleteActionVfModuleInstanceAction>action).dynamicModelName){
-          let oldAction = newState.serviceInstance[(<DeleteActionVfModuleInstanceAction>action).serviceId].vnfs[(<DeleteActionVfModuleInstanceAction>action).vnfStoreKey].vfModules[key][firstKey].action;
-          if(oldAction === ServiceInstanceActions.None_Delete || oldAction === ServiceInstanceActions.Update_Delete) return newState;
-          newState.serviceInstance[(<DeleteActionVfModuleInstanceAction>action).serviceId].vnfs[(<DeleteActionVfModuleInstanceAction>action).vnfStoreKey].vfModules[key][firstKey].action = (oldAction + '_Delete') as ServiceInstanceActions;
-          setLcpCloudRegionIdAndTenantIdFromVnf(newState, (<DeleteActionVfModuleInstanceAction>action).serviceId, (<DeleteActionVfModuleInstanceAction>action).vnfStoreKey, key, firstKey);
-          updateIsMissingDataOnDeleteVFModule(newState, (<UndoDeleteActionVfModuleInstanceAction>action).serviceId, (<UndoDeleteActionVfModuleInstanceAction>action).vnfStoreKey, key);
-          return newState;
-        }
-      }
       return newState;
     }
     case VfModuleActions.UNDO_DELETE_ACTION_VF_MODULE_INSTANCE : {
