Only one player gets added to match

In my game, we have a ready-up button that players can press and it sends a remote event to the server to add them to a table, when a round starts we grab all the players from that queue table and put them into a players playing table and then are teleported to the map, when i tested this with two players, only one player was teleported to the map

heres the code for it

local SpawnsMM = Map.Spawns:GetChildren()
for b,ia in pairs(playersinqueue) do
if ia ~= nil and ia.Character ~= nil then
table.remove(playersinqueue,b)
table.insert(playersPlaying,ia)
print(ia.Name…" has been added to the playersPlaying list!")

ia.Character:WaitForChild(“HumanoidRootPart”).CFrame =SpawnsMM[b].CFrame
game.ReplicatedStorage.Events.Client.DoPlaying:FireClient(ia)
end
end

Any help?

Nevermind i fixed it, i just did a seperate function to remove the players in the queue table