Added test for Query func