     
     override func viewDidAppear(animated: Bool) {
         super.viewDidAppear(animated)
+        self.updatePeripheralConnectionsSwitch = true
         self.stopPollingRSSIForPeripherals()
         NSNotificationCenter.defaultCenter().addObserver(self, selector:"didBecomeActive", name:BlueCapNotification.didBecomeActive, object:nil)
         NSNotificationCenter.defaultCenter().addObserver(self, selector:"didResignActive", name:BlueCapNotification.didResignActive, object:nil)


    override func viewWillDisappear(animated: Bool) {
        super.viewWillDisappear(animated)
        self.updatePeripheralConnectionsSwitch = true
        self.stopPollingRSSIForPeripherals()
    }


    
    override func tableView(tableView:UITableView, cellForRowAtIndexPath indexPath:NSIndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCellWithIdentifier(MainStoryboard.peripheralCell, forIndexPath: indexPath) as! PeripheralCell
        let peripheral: BCPeripheral
        if ConfigStore.getPeripheralSortOrder() == .DiscoveryDate {
             peripheral = Singletons.centralManager.peripherals[indexPath.row]
        } else {
            peripheral = self.peripheralsSortedByRSSI[indexPath.row]
        }
        cell.nameLabel.text = peripheral.name
        cell.accessoryType = .None
        if peripheral.state == .Connected {
