add a function which can be used to get a query string before execute query() function.