fixed errors in Device Query code