diff --git a/planetstack/openstack/observer.py b/planetstack/openstack/observer.py
index ac2d58a..ef09a11 100644
--- a/planetstack/openstack/observer.py
+++ b/planetstack/openstack/observer.py
@@ -10,10 +10,11 @@
     def __init__(self):
         self.manager = OpenStackManager() 
 
-    def sync_sites(self):
+    def sync_tenants(self):
         """
-        save all sites where enacted < updated or enacted == None. Remove sites that
-        no don't exist in openstack db if they have an enacted time (enacted != None).
+        Save all sites and sliceswhere enacted < updated or enacted == None. 
+        Remove sites and slices that no don't exist in openstack db if they 
+        have an enacted time (enacted != None).
         """ 
         # get all sites that need to be synced (enacted < updated or enacted is None)
         pending_sites = Site.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
@@ -22,24 +23,6 @@
             site.enacted = datetime.now()
             site.save()
 
-        # get all sites that where enacted != null. We can assume these sites
-        # have previously been synced and need to be checed for deletion.
-        sites = Site.objects.filter(enacted__isnull=False)
-        site_dict = {}
-        for site in sites:
-            site_dict[site.login_base] = site
-
-        # delete keystone tenants that don't have a site record
-        tenants = self.manager.driver.shell.keystone.tenants.findall()
-        for tenant in tenants:
-            if tenant.name not in site_dict:
-                self.manager.driver.delete_tenant(tenant.id)
-
-    def sync_slices(self):
-        """
-        save all slices where enacted < updated or enacted == None. Remove slices that
-        no don't exist in openstack db if they have an enacted time (enacted != None).
-        """
         # get all slices that need to be synced (enacted < updated or enacted is None)
         pending_slices = Slice.objects.filter(Q(enacted__lt=F('updated')) | Q(enacted=None))
         for slice in pending_slices:
@@ -47,6 +30,13 @@
             slice.enacted = datetime.now()
             slice.save()
 
+        # get all sites that where enacted != null. We can assume these sites
+        # have previously been synced and need to be checed for deletion.
+        sites = Site.objects.filter(enacted__isnull=False)
+        site_dict = {}
+        for site in sites:
+            site_dict[site.login_base] = site
+
         # get all slices that where enacted != null. We can assume these slices
         # have previously been synced and need to be checed for deletion.
         slices = Slice.objects.filter(enacted__isnull=False)
@@ -57,8 +47,12 @@
         # delete keystone tenants that don't have a site record
         tenants = self.manager.driver.shell.keystone.tenants.findall()
         for tenant in tenants:
-            if tenant.name not in slice_dict:
-                self.manager.driver.delete_tenant(tenant.id)                
+            if tenant.name == 'admin': 
+                continue
+            if tenant.name not in site_dict and tenant.name not in slice_dict:
+                print "delete " + tenant.name
+                #self.manager.driver.delete_tenant(tenant.id)
+
 
     def sync_users(self):
         """
@@ -82,10 +76,12 @@
         # delete keystone users that don't have a user record
         user = self.manager.driver.shell.keystone.users.findall()
         for user in users:
+            if user.name == 'admin':
+                continue
             if user.id not in user_dict:
-                self.manager.driver.delete_user(user.id)
+                pass
+                #self.manager.driver.delete_user(user.id)
         
-
         
     def sync_slivers(self):
         """
