Fixed a bug when device becomes disconnected, the device scanning function isn't called