Voting System Not Working

Hello!
I’m trying to make a voting system, but it’s not working!
Here is my script:


local function SelectMap()
	local PossibleMaps = ServerStorage.Maps:GetChildren()
	local ChosenMap = PossibleMaps[math.random(1,#PossibleMaps)]
	for i, Vote in pairs(ReplicatedStorage.Votes:GetChildren()) do
		if Vote.Value > game.ReplicatedStorage.Votes:FindFirstChild(ChosenMap.Name).Value then
			ChosenMap = game.ServerStorage:FindFirstChild(Vote.Name)
		end
	end
	return ChosenMap
end

Here is my ServerStorage layout:
NewLayout

Here is the ReplicatedStorage Layout:

Votes

Here is the error:

Error

I voted for Map1. Map 3 isn’t built yet!

Try putting a placeholder value for Map3 in Maps.

That worked once, but stopped the next.

The issue occurs when it randomly selects map 2. When it selects map 1 randomly, it’s fine!

In this line:

local ChosenMap = PossibleMaps[math.random(1,#PossibleMaps)]

ChosenMap = game.ServerStorage:FindFirstChild(Vote.Name)
It looks like you might have forgotten to add ‘Maps’ after ‘ServerStorage’?