fixed issue with getting the record count for a category