making queries work