Problems with Inventory System

I am working on an inventory system, and for some reason this code only prints the first name of the object in the list.

if(gameObject.GetComponent<PlayerControl>().dead == true)
		{
			foreach(GameObject weapon in weapons)
			{
				print(weapon);
				weapon.gameObject.GetComponent<GunScript>().beingHeld = false;
			}
		}

Can anyone explain this?

do the 2 items have the same name? check the “collapse” is not on in your console window.