fixed a reported bug in device list function