     public var supportsFlySensorCalibration: Bool { return flySensorCalibrationCharacteristic != nil }
     public var heartBeatInterval: TimeInterval = 0.0 { didSet { writeHeartBeatInterval() } }
 
-    private var matrixWriter: LEDMatrixWriter?
+    private lazy var matrixWriter: LEDMatrixWriter = LEDMatrixWriter(controller: self)
     private var connectTimeoutTimer: Timer?
     private var rebootToDFUModeCharacteristic: CBCharacteristic? { return peripheral?.service(with: kSensorServiceUUID)?.characteristic(with: kRebootToDFUModeCharacteristicUUID) }
     private var flySensorCalibrationCharacteristic: CBCharacteristic? { return peripheral?.service(with: kSensorServiceUUID)?.characteristic(with: kFlySensorCalibrationCharacteristicUUID) }
 
     open override func didUpdateState(error: Error? = nil) {
         super.didUpdateState()
+        if peripheral?.state != .connected {
+            matrixWriter.matrixCharacteristic = nil
+        }
         let newState: NuimoConnectionState =  {
             guard isReachable, let peripheral = peripheral else { return .invalidated }
             switch peripheral.state {

        delegate?.nuimoController(self, didChangeConnectionState: connectionState, withError: error)
    }

    open override func willDiscoverServices() {
        super.willDiscoverServices()
        matrixWriter = nil
    }

    public func display(matrix: NuimoLEDMatrix, interval: TimeInterval, options: Int) {
        queue.async {
            self.matrixWriter?.write(matrix: matrix, interval: interval, options: options)
        }
    }


//MARK: - LED matrix writing

private class LEDMatrixWriter {
    unowned let controller: NuimoBluetoothController
    var matrixCharacteristic: CBCharacteristic?

    private var currentMatrix: NuimoLEDMatrix?
    private var currentDisplayInterval: TimeInterval = 0.0
