Query wait() works