     func centralManager(_ central: CBCentralManager!, didRetrievePeripherals peripherals: [AnyObject]!) {
         for peripheral in peripherals as! [CBPeripheral] {
             print("\(#function): peripheral = \(peripheral)")
-            if !(_heartRateMonitor != nil) {
+            if !(heartRateMonitor != nil) {
                 connectToPeripheral(peripheral)
                 break;
             }

        // create the serial queue for the central manager to use
        centralManagerQueue = DispatchQueue(label: centralManagerQueueName, attributes: [])
        super.init()
         // create the central manager with us as the delegate
        centralManager = CBCentralManager(delegate: self, queue: centralManagerQueue)
    }
    

    
    // connect to the found periperal
    func connectToPeripheral(_ peripheral: CBPeripheral) {
        heartRateMonitor = peripheral;
        centralManager.connect(peripheral, options: nil)
    }
    
