fix for total number of entries from index if using filter, renamed check function to count and added limit