added test script to run query directly