     
         public func centralManager(central: CBCentralManager, didDiscoverPeripheral peripheral: CBPeripheral, advertisementData: [String : AnyObject], RSSI: NSNumber)
         {
-            log("Did discover peripheral: \(peripheral.name)")
-            bluetoothManager.stopScan()
-            connectPeripheral(peripheral)
+            log("Did discover peripheral: \(peripheral.name!)")
+            //bluetoothManager.stopScan()
+            
+            if peripheral.name == arduinoToConnect{
+                connectPeripheral(peripheral)
+            }
+            
         }
     
         public func centralManager(central: CBCentralManager, didConnectPeripheral peripheral: CBPeripheral)

public class NRFManager:NSObject, CBCentralManagerDelegate, UARTPeripheralDelegate {
    

    //Private Properties
    private var bluetoothManager:CBCentralManager!
    private var currentPeripheral: UARTPeripheral? {

// MARK: - Public Methods
extension NRFManager {
    
    public func connect(arduinoName: String) {
        if currentPeripheral != nil && connectionStatus == .Connected {
            log("Asked to connect, but already connected!")
            return
        }
        self.arduinoToConnect = arduinoName
        scanForPeripheral()
    }
    
