diff --git a/xos/core/xoslib/methods/cordsubscriber.py b/xos/core/xoslib/methods/cordsubscriber.py
index 5742c9c..83dc916 100644
--- a/xos/core/xoslib/methods/cordsubscriber.py
+++ b/xos/core/xoslib/methods/cordsubscriber.py
@@ -311,9 +311,24 @@
         subscriber.save()
         return Response({service: getattr(subscriber, service_attr)})
 
+    def setup_demo_vcpe(self, voltTenant):
+        # nuke the users and start over
+        voltTenant.vcpe.users = []
+        voltTenant.vcpe.create_user(name="Mom's PC",      mac="01020303040506", level="PG_13")
+        voltTenant.vcpe.create_user(name="Dad's PC",      mac="01020304040507", level="PG_13")
+        voltTenant.vcpe.create_user(name="Jack's iPhone", mac="01020304050508", level="PG_13")
+        voltTenant.vcpe.create_user(name="Jill's iPad",   mac="01020304050609", level="PG_13")
+        voltTenant.vcpe.save()
+
     def initdemo(self, request):
         object_list = VOLTTenant.get_tenant_objects().all()
 
+        # reset the parental controls in any existing demo vCPEs
+        for o in object_list:
+            if str(o.subscriber_specific_id) in ["0", "1"]:
+                if o.vcpe is not None:
+                    self.setup_demo_vcpe(o)
+
         demo_subscribers = [o for o in object_list if o.is_demo_user]
 
         if demo_subscribers:
@@ -325,11 +340,7 @@
         voltTenant.caller = User.objects.get(email="padmin@vicci.org")
         voltTenant.save()
 
-        voltTenant.vcpe.create_user(name="Mom's PC",      mac="01020303040506", level="R")
-        voltTenant.vcpe.create_user(name="Dad's PC",      mac="01020304040507", level="R")
-        voltTenant.vcpe.create_user(name="Jack's iPhone", mac="01020304050508", level="PG")
-        voltTenant.vcpe.create_user(name="Jill's iPad",   mac="01020304050609", level="G")
-        voltTenant.vcpe.save()
+        self.setup_demo_vcpe(voltTenant)
 
         return Response({"id": voltTenant.id})
 
@@ -343,7 +354,7 @@
     def ssiddetail(self, pk=None, ssid=None):
         object_list = VOLTTenant.get_tenant_objects().all()
 
-        ssidmap = [ {"service_specific_id:": x.service_specific_id, "subscriber_id": x.id} for x in object_list if str(x.service_specific_id)==str(ssid) ]
+        ssidmap = [ {"service_specific_id": x.service_specific_id, "subscriber_id": x.id} for x in object_list if str(x.service_specific_id)==str(ssid) ]
 
         if len(ssidmap)==0:
             raise XOSNotFound("didn't find ssid %s" % str(ssid))
