Fix for query error when not counting for page numbers in getData().