ArgumentOutOfRangeException Crafting System problem.

So I’m trying to create a basic crafting system (I’m still learning so ye) I started with creating an inventory system and equipment system, now when i started working on the crafting system i just wanted to test out a function which will simply check the item the player need in the inventory and then (if its found) he can create the new item which will be set directly into his inventory. So here is my code

    Item item;
    public Inventory inventory;
    
    //Method that will craft the item 
    public void CraftItem(Item item)
    {
        if (item.name == "WaterBottle")
        {
            bool allowCraft = inventory.CheckItem("EmptyBottle");
            if (allowCraft)
            {
                Debug.Log("Crafting  " + item.name);
                bool wasCrafted = Inventory.instance.Add(item);
                allowCraft = false;
            }
            else
                Debug.Log("YOU DONT HAVE THE NEEDED ITEMS");
        }
    }

And here is the method in the inventory script that will check if the player has the needed items to craft.

//Check if the item is in the inventory
public bool CheckItem(string itemName)
    {
        bool itemFound = false;
        for (int i = 0; i <= items.Count; i++)
        {
            if (items*.itemName == itemName)*

{
itemFound = true;
}
else
itemFound = false;
}
return itemFound;

}
But i keep getting this error whenever i click craft,

PS THE ERROR IS IN LINE 9 OF THE FIRST SCRIPT.
For some reason i keep getting ArgumentOutOfRangeException (When i delete that line; it works perfectly but i’ll be able to spam craft even if i dont have the needed item.)

Fixed

All i had to do is change the for loop in the CheckItem method with foreach loop.