Modify device query