Adding a query script