Update logic for pager based on total and query count