diff --git a/planetstack/observer/steps/sync_roles.py b/planetstack/observer/steps/sync_roles.py
index 18a784a..5dc30d9 100644
--- a/planetstack/observer/steps/sync_roles.py
+++ b/planetstack/observer/steps/sync_roles.py
@@ -29,12 +29,9 @@
 
 
     def sync_record(self, role):
-        save_role = False
-        if not role.krole_id:
-            krole = self.driver.create_role(role.role)
-            role.krole_id = krole.id
-            save_role = True
-
-        if (save_role):
-            role.save()
-    
+        if not role.enacted:
+            deployments = Deployment.objects.all()
+            for deployment in deployments:
+                driver = self.driver.admin_driver(deployment=deployment.name)
+                driver.create_role(role.role)
+            role.save()    
diff --git a/planetstack/observer/steps/sync_slice_memberships.py b/planetstack/observer/steps/sync_slice_memberships.py
index 6a4f75f..b6b1638 100644
--- a/planetstack/observer/steps/sync_slice_memberships.py
+++ b/planetstack/observer/steps/sync_slice_memberships.py
@@ -19,7 +19,8 @@
         for slice_deployment in slice_deployments:
             if not slice_deployment.tenant_id:
                 continue
-            user_deployments = UserDeployments.objects.filter(deployment=slice_deployment.deployment)
+            user_deployments = UserDeployments.objects.filter(deployment=slice_deployment.deployment,
+                                                              user=slice_memb.user)
             if user_deployments:
                 kuser_id  = user_deployments[0].kuser_id
                 driver = self.driver.admin_driver(deployment=slice_deployment.deployment.name)
diff --git a/planetstack/observer/steps/sync_slivers.py b/planetstack/observer/steps/sync_slivers.py
index 299d079..9780dcb 100644
--- a/planetstack/observer/steps/sync_slivers.py
+++ b/planetstack/observer/steps/sync_slivers.py
@@ -34,7 +34,8 @@
             pubkeys = [sm.user.public_key for sm in slice_memberships if sm.user.public_key]
             if sliver.creator.public_key:
                 pubkeys.append(sliver.creator.public_key)
-            
+            if sliver.slice.creator.public_key:
+                pubkeys.append(sliver.slice.creator.public_key) 
             # netowrks
             #nics = self.get_requested_networks(sliver.slice, sliver.node.deployment)
             nics = []
@@ -76,8 +77,8 @@
                                 nics = nics )
             sliver.instance_id = instance.id
             sliver.instance_name = getattr(instance, 'OS-EXT-SRV-ATTR:instance_name')
+            sliver.save()    
 
         if sliver.instance_id and metadata_update:
             driver.update_instance_metadata(sliver.instance_id, metadata_update)
 
-        sliver.save()    
diff --git a/planetstack/openstack/driver.py b/planetstack/openstack/driver.py
index 5b8e728..b8faf25 100644
--- a/planetstack/openstack/driver.py
+++ b/planetstack/openstack/driver.py
@@ -48,10 +48,12 @@
 
     def create_role(self, name):
         roles = self.shell.keystone.roles.findall(name=name)
-        if not roles:
+        roles_title = self.shell.keystone.roles.findall(name=name.title())
+        roles_found = roles + roles_title
+        if not roles_found:
             role = self.shell.keystone.roles.create(name)
         else:
-            role = roles[0]
+            role = roles_found[0]
         return role
 
     def delete_role(self, filter):
