add test that counts number of queries