bug fix to the bluetooth connection process.