mode condition added to 'onCharacteristicChanged'