fixed and renamed runQuery (to query)