fix exception caused by sudden bluetooth disconnect