checking query commands