correctly count total_entries for sort by source