Instanciate infinite objects - foreach problem [C#]

Hi everybody !
I make a game with an inventory. When the player open the inventory menu, i would instantiates all items who are in a List. The items are instanciate but the problem is: my script instantiate my items and an infinite numbers of items (with the properties from the good items).

In the game there are only the good items that are display.

This is my script :
(BaseItem is my item script, ownedItems a List with BaseItems, defaultItem an empty GameObject, AddMember() a method in the BaseItem script, and the last part of the script is for display names and informations in game (that work perfectly))

int i = new int();
                foreach (BaseItem bI in player.GetComponent<Player>().ownedItems)
                    defaultItem = (GameObject)Instantiate(emptyItem, new Vector3(0, 0, 0), Quaternion.identity);

                    BaseItem it = defaultItem.AddComponent<BaseItem>() as BaseItem;

                    defaultItem.transform.parent = inventory.transform;
                    defaultItem.transform.localPosition = new Vector3(0, 1, 0);

                    if (i == 1)
               = it.IName;
                        oneT = it.IName;
                        oneI = it;
                    else if (i == 10)
               = it.IName;
                        tenT= it.IName;

Thank you,

Bye, xyHeat

Thanks to @HarshadK that answer to the question !

I put the foreach inan other method who is calling in the update method with : Input.GetKeyDown(KeyCode.A).

Bye, xyHeat