     
     
     func scanning(lobby : LobbyViewController) -> Receive {
-        print("Scanning")
-        let l : LobbyViewController = lobby
-        ^{
-            let browser = MCBrowserViewController(serviceType: self.service, session: self.session);
-            browser.delegate = self;
-            browser.minimumNumberOfPeers = 2
-            browser.maximumNumberOfPeers = 2
-            browser.modalPresentationStyle = UIModalPresentationStyle.FormSheet
-            self.mcAdvertiserAssistant = MCAdvertiserAssistant(serviceType: self.service, discoveryInfo: nil, session: self.session)
-            self.mcAdvertiserAssistant.start()
-            lobby.presentViewController(browser, animated: true, completion: { () -> Void in
-                
-            })
-        }
-        return {[unowned self] (msg : Message) in
+        return {[unowned self] (msg : Message) in
+            print("Scanning")
             switch(msg) {
                 case is StartScanning:
-                    print("Already scanning")
+                    ^{
+                        lobby.navigationController?.popToViewController(lobby, animated: true)
+                    }
+                    self.session = MCSession(peer: self.peerID)
+                    self.session.delegate = self
+                    ^{
+                        let browser = MCBrowserViewController(serviceType: self.service, session: self.session);
+                        browser.delegate = self;
+                        browser.minimumNumberOfPeers = 2
+                        browser.maximumNumberOfPeers = 2
+                        browser.modalPresentationStyle = UIModalPresentationStyle.FormSheet
+                        self.mcAdvertiserAssistant = MCAdvertiserAssistant(serviceType: self.service, discoveryInfo: nil, session: self.session)
+                        self.mcAdvertiserAssistant.start()
+                        lobby.presentViewController(browser, animated: true, completion: { () -> Void in
+                            
+                        })
+                    }
+
                     break
                 case let w as OnConnectToDevice:
-                    self.become(self.connected(l, peer: w.peer))
+                    self.become(self.connected(lobby, peer: w.peer))
                     self.mcAdvertiserAssistant.stop()
                     break
                 case is Disconnect:

                    }
                    
                break
                case is UnbecomeCamera:
                    self.unbecome()
                break

    }
    
    func monitor(peer : MCPeerID) -> Receive {
        return {[unowned self] (msg : Message) in
            print("monitor")
            switch(msg) {
                case is OnFrame:
                    print("ignoring frame")
                    break
                case let m as AddMonitor:
                    print("adding monitor")
                    self.become(self.monitorWithMonitor(m.sender!, peer: peer))
                    break
                
                case is UnbecomeMonitor:
                    self.unbecome()
                    break
                
                case let c as DisconnectPeer:
                    if (c.peer.displayName == peer.displayName) {
                        self.unbecome()
                        self.this ! c
                    }
                    break
                
                case is Disconnect:
                    self.unbecome()
                    self.this ! msg
