added index filtering logic