Unable to destroy a team

When a team has no members, it is supposed to destroy it. Everything works, but the team is not destroyed for some reason. How do I fix this?

	if #game.Teams[StoredTeam]:GetPlayers() == 0 then
		local t = game:GetService('Teams'):WaitForChild(StoredTeam)
		t:Destroy()
		print('Destroyed!')
		print(game.Teams:FindFirstChild(StoredTeam))
	end

See how I make the code print “Destroyed” and then print weather the team exists or not after that, and it does exist. So why is the team not being destroyed?

image

All help is appreciated, thank you :smile: