diff --git a/person_detection/base_camera.py b/person_detection/base_camera.py
index a479166..88a1e0e 100644
--- a/person_detection/base_camera.py
+++ b/person_detection/base_camera.py
@@ -52,20 +52,23 @@
 
 
 class BaseCamera(object):
-    thread = None  # background thread that reads frames from camera
-    frame = None  # current frame is stored here by background thread
-    last_access = 0  # time of last client access to the camera
-    event = CameraEvent()
-    port = 0 # default starting port offset
+    thread = {} # background thread that reads frames from camera
+    frame = {} # current frame is stored here by background thread
+    last_access = {}  # time of last client access to the camera
+    event = {}
 
-    def __init__(self):
+    def __init__(self, device=None):
         """Start the background camera thread if it isn't running yet."""
-        if BaseCamera.thread is None:
-            BaseCamera.last_access = time.time()
+        self.device = device
+        BaseCamera.event[self.device] = CameraEvent()
+        if self.device not in BaseCamera.thread:
+            BaseCamera.thread[self.device] = None
+        if BaseCamera.thread[self.device] is None:
+            BaseCamera.last_access[self.device] = time.time()
 
             # start background frame thread
-            BaseCamera.thread = threading.Thread(target=self._thread)
-            BaseCamera.thread.start()
+            BaseCamera.thread[self.device] = threading.Thread(target=self._thread, args=(self.device))
+            BaseCamera.thread[self.device].start()
 
             # wait until frames are available
             while self.get_frame() is None:
@@ -73,30 +76,30 @@
 
     def get_frame(self):
         """Return the current camera frame."""
-        BaseCamera.last_access = time.time()
+        BaseCamera.last_access[self.device] = time.time()
 
         # wait for a signal from the camera thread
-        BaseCamera.event.wait()
-        BaseCamera.event.clear()
+        BaseCamera.event[self.device].wait()
+        BaseCamera.event[self.device].clear()
 
-        return BaseCamera.frame
+        return BaseCamera.frame[self.device]
 
     def frames(self):
         """"Generator that returns frames from the camera."""
         raise NotImplementedError('Must be implemented by subclasses.')
 
-    def _thread(self):
+    def _thread(self, device):
         """Camera background thread."""
         frames_iterator = self.frames()
         for frame in frames_iterator:
-            BaseCamera.frame = frame
-            BaseCamera.event.set()  # send signal to clients
+            BaseCamera.frame[device] = frame
+            BaseCamera.event[device].set()  # send signal to clients
             time.sleep(0)
 
             # if there hasn't been any clients asking for frames in
             # the last 10 seconds then stop the thread
-            if time.time() - BaseCamera.last_access > 10:
+            if time.time() - BaseCamera.last_access[device] > 10:
                 frames_iterator.close()
                 print('Stopping camera thread due to inactivity.')
                 break
-        BaseCamera.thread = None
+        BaseCamera.thread[device] = None
