Picking up multiple items at once doesnt update ui

so I have an inventory and when I pick up a group of items when the player doesnt have it yet, it bugs out for one of the items and makes the value only 1

this issue is really bugging me and I cant figure out why its happening

code :

if table.find(itemList,item.Name) and equation then
	if _G.Data[player.UserId][item.Name] == nil then -- If they dont have the item
		_G.Data[player.UserId][item.Name] = 1 -- make a new item inside of their inventory table
		local function placeItem(slot)
			local Sample = slotsFrame.Sample.Item:Clone()
			Sample.Name = item.Name
			Sample.itemName.Text = item.Name
			Sample.Visible = true
			Sample.Parent = slot
			Sample.Amount.Text = "x".._G.Data[player.UserId][item.Name]
			print(slot.Name.." is empty!")
			function getItem()
				return Sample

Fixed the issue, its because I wasnt updating it every single slot the item went into :joy: