Added a method for getting the queryId from the cursor