             } else {
                 cell.accessoryType = .DisclosureIndicator
             }
-        } else  if self.isInRegion {
+        } else  if isBeaconInRegion {
             cell.accessoryType = .None
             cell.rangingActivityIndicator.startAnimating()
         } else {

                    for beacon in beacons {
                        Logger.debug("major:\(beacon.major), minor: \(beacon.minor), rssi: \(beacon.rssi)")
                    }
                    if !self.isRanging {
                        self.isRanging = true
                        self.updateWhenActive()
                    }
                    if UIApplication.sharedApplication().applicationState == .Active {
                        NSNotificationCenter.defaultCenter().postNotificationName(BlueCapNotification.didUpdateBeacon, object:beaconRegion)

            BeaconManager.sharedInstance().stopMonitoringAllRegions()
            self.beaconRegions.removeAll(keepCapacity:false)
            self.setScanButton()
        } else {
            self.startMonitoring()
        }
