implement the device query