Now get the query from the adapter (bug fix).