Random Time Event Not Working

Hiya, I am making this thing where an event occurs like every 2 minutes per say. After testing this it doesn’t seem to work. I do not get an output either. Any help is appreciated. Here is my script for reference

local InsanityTableEventList = {
	{
		name = "GainInsanity",
		Function = function()
			print("test")
		end,
	}
}

local Intervals = 5*10
local TimerValue = 0
RunService.Heartbeat:Connect(function(Seconds)
	TimerValue += Seconds
	
	if TimerValue > Intervals then TimerValue = TimerValue % Intervals
		local EventChosen = math.random(#InsanityTableEventList)
		local EventOccuring = InsanityTableEventList[EventChosen]
		local EventOccuringName = EventOccuring.Name
		local EventsFunction = EventOccuring.Function
		
		print("an event occured "..EventOccuringName)
		EventsFunction()
	end
end)

Does it work if you remove the random element and just select the first event? Also you have a mismatch (name and Name) but that shouldn’t matter.