diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/events/lcm/LcmEventsCmHandleStateHandlerImpl.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/events/lcm/LcmEventsCmHandleStateHandlerImpl.java
index 2f77ec3..ce19712 100644
--- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/events/lcm/LcmEventsCmHandleStateHandlerImpl.java
+++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/events/lcm/LcmEventsCmHandleStateHandlerImpl.java
@@ -100,14 +100,13 @@
                 cmHandleTransitionPairs.add(cmHandleTransitionPair);
             }
         });
-
         return cmHandleTransitionPairs;
     }
 
 
     private void persistCmHandle(final YangModelCmHandle targetYangModelCmHandle,
             final YangModelCmHandle currentYangModelCmHandle) {
-        if (isNew(currentYangModelCmHandle.getCompositeState(), targetYangModelCmHandle.getCompositeState())) {
+        if (isNew(currentYangModelCmHandle.getCompositeState())) {
             log.debug("Registering a new cm handle {}", targetYangModelCmHandle.getId());
             inventoryPersistence.saveCmHandle(targetYangModelCmHandle);
         } else if (isDeleted(targetYangModelCmHandle.getCompositeState())) {
@@ -124,8 +123,8 @@
         final Map<String, CompositeState> compositeStatePerCmHandleId = new LinkedHashMap<>();
 
         cmHandleTransitionPairs.forEach(cmHandleTransitionPair -> {
-            if (isNew(cmHandleTransitionPair.getCurrentYangModelCmHandle().getCompositeState(),
-                    cmHandleTransitionPair.getTargetYangModelCmHandle().getCompositeState())) {
+            if (isNew(cmHandleTransitionPair.getCurrentYangModelCmHandle().getCompositeState()
+            )) {
                 newCmHandles.add(cmHandleTransitionPair.getTargetYangModelCmHandle());
             } else if (!isDeleted(cmHandleTransitionPair.getTargetYangModelCmHandle().getCompositeState())) {
                 compositeStatePerCmHandleId.put(cmHandleTransitionPair.getTargetYangModelCmHandle().getId(),
@@ -172,8 +171,8 @@
         CompositeStateUtils.setCompositeState(targetCmHandleState).accept(yangModelCmHandle.getCompositeState());
     }
 
-    private boolean isNew(final CompositeState existingCompositeState, final CompositeState targetCompositeState) {
-        return (existingCompositeState == null && targetCompositeState.getCmHandleState() == ADVISED);
+    private boolean isNew(final CompositeState existingCompositeState) {
+        return (existingCompositeState == null);
     }
 
     private boolean isDeleted(final CompositeState targetCompositeState) {
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/lcm/LcmEventsCmHandleStateHandlerImplSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/lcm/LcmEventsCmHandleStateHandlerImplSpec.groovy
index bfebc44..261b6e0 100644
--- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/lcm/LcmEventsCmHandleStateHandlerImplSpec.groovy
+++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/lcm/LcmEventsCmHandleStateHandlerImplSpec.groovy
@@ -63,7 +63,7 @@
             'ADVISED to ADVISED' | ADVISED           | ADVISED         || 0                                   | 0
             'READY to READY'     | READY             | READY           || 0                                   | 0
             'LOCKED to LOCKED'   | LOCKED            | LOCKED          || 0                                   | 0
-
+            'DELETED to ADVISED' | DELETED           | ADVISED         || 0                                   | 1
     }
 
     def 'Update and Publish Events on State Change from NO_EXISTING state to ADVISED'() {
@@ -94,6 +94,17 @@
             1 * mockLcmEventsService.publishLcmEvent(cmHandleId, _, _)
     }
 
+    def 'Update and Publish Events on State Change from DELETING to ADVISED'() {
+        given: 'Cm Handle represented as YangModelCmHandle in DELETING state'
+            yangModelCmHandle = new YangModelCmHandle(id: cmHandleId, dmiProperties: [], publicProperties: [], compositeState: compositeState)
+        when: 'update state is invoked'
+            objectUnderTest.updateCmHandleState(yangModelCmHandle, ADVISED)
+        then: 'the cm handle is saved using inventory persistence'
+            1 * mockInventoryPersistence.saveCmHandle(yangModelCmHandle)
+        and: 'event service is called to publish event'
+            1 * mockLcmEventsService.publishLcmEvent(cmHandleId, _, _)
+    }
+
     def 'Update and Publish Events on State Change to READY'() {
         given: 'Cm Handle represented as YangModelCmHandle'
             compositeState = new CompositeState(cmHandleState: ADVISED)
@@ -167,7 +178,7 @@
                     assert (args[0] as Collection<YangModelCmHandle>).id.containsAll('cmhandle1', 'cmhandle2')
                 }
             }
-        and: 'event service is called to publish event'
+        and: 'event service is called to publish events'
             2 * mockLcmEventsService.publishLcmEvent(_, _, _)
 
     }
@@ -183,9 +194,23 @@
                     assert (args[0] as Map<String, CompositeState>).keySet().containsAll(['cmhandle1','cmhandle2'])
                 }
             }
-        and: 'event service is called to publish event'
+        and: 'event service is called to publish events'
             2 * mockLcmEventsService.publishLcmEvent(_, _, _)
+    }
 
+    def 'Batch of existing cm handles is deleted'() {
+        given: 'A batch of deleted cm handles'
+            def cmHandleStateMap = setupBatch('DELETED')
+        when: 'updating a batch of changes'
+            objectUnderTest.updateCmHandleStateBatch(cmHandleStateMap)
+        then : 'existing cm handles composite state is persisted'
+            1 * mockInventoryPersistence.saveCmHandleStateBatch(_) >> {
+                args -> {
+                    assert (args[0] as Map<String, CompositeState>).isEmpty()
+                }
+            }
+        and: 'event service is called to publish events'
+            2 * mockLcmEventsService.publishLcmEvent(_, _, _)
     }
 
     def setupBatch(type) {
@@ -197,6 +222,12 @@
             return [(yangModelCmHandle1): ADVISED, (yangModelCmHandle2): ADVISED]
         }
 
+        if ('DELETED' == type) {
+            yangModelCmHandle1.compositeState = new CompositeState(cmHandleState: READY)
+            yangModelCmHandle2.compositeState = new CompositeState(cmHandleState: READY)
+            return [(yangModelCmHandle1): DELETED, (yangModelCmHandle2): DELETED]
+        }
+
         if ('UPDATE' == type) {
             yangModelCmHandle1.compositeState = new CompositeState(cmHandleState: ADVISED)
             yangModelCmHandle2.compositeState = new CompositeState(cmHandleState: READY)
@@ -209,4 +240,4 @@
             return [(yangModelCmHandle1): ADVISED, (yangModelCmHandle2): READY]
         }
     }
-}
\ No newline at end of file
+}
