diff --git a/xos/synchronizer/steps/sync_tech_profile.py b/xos/synchronizer/steps/sync_tech_profile.py
index dcd5f52..ad16f00 100644
--- a/xos/synchronizer/steps/sync_tech_profile.py
+++ b/xos/synchronizer/steps/sync_tech_profile.py
@@ -16,14 +16,12 @@
 sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
 from helpers import Helpers
-
 import requests
 from multistructlog import create_logger
 from requests.auth import HTTPBasicAuth
 from xossynchronizer.modelaccessor import TechnologyProfile, model_accessor
 from xossynchronizer.steps.syncstep import SyncStep
 from xosconfig import Config
-
 import etcd3
 
 # TODO store ETCD_HOST_URL and ETCD_PORT in the vOLT Service model
@@ -33,26 +31,28 @@
 
 log = create_logger(Config().get("logging"))
 
+
 class SyncTechnologyProfile(SyncStep):
     provides = [TechnologyProfile]
 
     observes = TechnologyProfile
 
-    def update_etcd(self, operation, key, value):
+    def update_etcd(self, operation, key, value=None):
         log.info('Update Etcd store: ', operation=operation, key=PREFIX + key, value=value)
-
         etcd = etcd3.client(host=ETCD_HOST_URL, port=ETCD_PORT)
         if operation == 'PUT':
-           etcd.put(PREFIX + key, value)
-           log.info('Technology Profile [%s] saved successfully to Etcd store' % (PREFIX + key))
+            etcd.put(PREFIX + key, value)
+            log.info('Technology Profile [%s] saved successfully to Etcd store' % (PREFIX + key))
+        elif operation == 'GET':
+            return etcd.get(PREFIX + key)
         elif operation == 'DELETE':
-           if False == etcd.delete(PREFIX + key):
-               log.error('Error while deleting Technology Profile [%s] from Etcd store' % key)
-               raise Exception('Failed to delete Technology Profile')
-           else:
-               log.info('Technology Profile [%s] deleted successfully from Etcd store' % key)
+            if False == etcd.delete(PREFIX + key):
+                log.error('Error while deleting Technology Profile [%s] from Etcd store' % key)
+                raise Exception('Failed to delete Technology Profile')
+            else:
+                log.info('Technology Profile [%s] deleted successfully from Etcd store' % key)
         else:
-           log.warning('Invalid or unsupported Etcd operation: %s' % operation)
+            log.warning('Invalid or unsupported Etcd operation: %s' % operation)
 
     def sync_record(self, model):
 
@@ -61,13 +61,14 @@
         log.info('TechnologyProfile: %s : %s' % (model.technology, model.profile_id))
 
         tp_key = u'/' + model.technology + u'/' + str(model.profile_id)
-        self.update_etcd('PUT', tp_key, model.profile_value)
+        self.update_etcd('PUT', tp_key, value=model.profile_value)
 
     def delete_record(self, model):
         log.info('Deleting TechnologyProfile', object=str(model), **model.tologdict())
 
         log.info('TechnologyProfile: %s : %s' % (model.technology, model.profile_id))
 
-        tp_key = u'/' + model.technology + u'/' + str(model.profile_id)
-        self.update_etcd('DELETE', tp_key, None)
-
+        tp_key = "/%s/%s" % (model.technology, model.profile_id)
+        [existing_tp, metadata] = self.update_etcd('GET', tp_key)
+        if existing_tp is not None:
+            self.update_etcd('DELETE', tp_key)
