diff --git a/planetstack/openstack_observer/steps/sync_network_deployments.py b/planetstack/openstack_observer/steps/sync_network_deployments.py
index 04f3270..c776ff1 100644
--- a/planetstack/openstack_observer/steps/sync_network_deployments.py
+++ b/planetstack/openstack_observer/steps/sync_network_deployments.py
@@ -16,31 +16,34 @@
     requested_interval = 0 
     provides=[Network, NetworkDeployments, Sliver]
     
-    def fetch_pending(self):
-        # network deployments are not visible to users. We must ensure
-        # networks are deployed at all deploymets available to their slices. 
-        slice_deployments = SliceDeployments.objects.all()
-        slice_deploy_lookup = defaultdict(list)
-        for slice_deployment in slice_deployments:
-            slice_deploy_lookup[slice_deployment.slice].append(slice_deployment.deployment)
-        
-        network_deployments = NetworkDeployments.objects.all()
-        network_deploy_lookup = defaultdict(list)
-        for network_deployment in network_deployments:
-            network_deploy_lookup[network_deployment.network].append(network_deployment.deployment)
+    def fetch_pending(self, deleted):
+        if (deleted):
+            return NetworkDeployments.deleted_objects.all()
+        else:
+            # network deployments are not visible to users. We must ensure
+            # networks are deployed at all deploymets available to their slices. 
+            slice_deployments = SliceDeployments.objects.all()
+            slice_deploy_lookup = defaultdict(list)
+            for slice_deployment in slice_deployments:
+                slice_deploy_lookup[slice_deployment.slice].append(slice_deployment.deployment)
+            
+            network_deployments = NetworkDeployments.objects.all()
+            network_deploy_lookup = defaultdict(list)
+            for network_deployment in network_deployments:
+                network_deploy_lookup[network_deployment.network].append(network_deployment.deployment)
 
-        for network in Network.objects.filter():
-            # ignore networks that have
-            # template.visibility = private and translation = none
-            if network.template.visibility == 'private' and not network.template.translation == 'none':
-                continue				
-            expected_deployments = slice_deploy_lookup[network.owner]
-            for expected_deployment in expected_deployments:
-                if network not in network_deploy_lookup or \
-                  expected_deployment not in network_deploy_lookup[network]:
-                    nd = NetworkDeployments(network=network, deployment=expected_deployment)
-                    nd.save()
-        return NetworkDeployments.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
+            for network in Network.objects.filter():
+                # ignore networks that have
+                # template.visibility = private and translation = none
+                if network.template.visibility == 'private' and not network.template.translation == 'none':
+                    continue				
+                expected_deployments = slice_deploy_lookup[network.owner]
+                for expected_deployment in expected_deployments:
+                    if network not in network_deploy_lookup or \
+                      expected_deployment not in network_deploy_lookup[network]:
+                        nd = NetworkDeployments(network=network, deployment=expected_deployment)
+                        nd.save()
+            return NetworkDeployments.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
 
     def get_next_subnet(self, deployment=None):
         # limit ourself to 10.0.x.x for now
@@ -114,4 +117,15 @@
                 raise e            
         
           
-    
+    def delete_record(self, network_deployment): 
+        driver = OpenStackDriver().client_driver(caller=network_deployment.network.owner.creator,
+                                                 tenant=network_deployment.network.owner.name,
+                                                 deployment=network_deployment.deployment.name)
+        if (network_deployment.router_id) and (network_deployment.subnet_id):
+            driver.delete_router_interface(network_deployment.router_id, network_deployment.subnet_id)
+        if network_deployment.subnet_id:
+            driver.delete_subnet(network_deployment.subnet_id)
+        if network_deployment.router_id:
+            driver.delete_router(network_deployment.router_id)
+        if network_deployment.net_id:
+            driver.delete_network(network_deployment.net_id)
