Add free query function (runQuery)