Fix query result doc fetching