added ble_error state check for restarting the device