Bug fix for scan for devices not working