To start with, templates a passed as strings. Your frameList is empty because you're really defined it as
Lua Code:
local frameList = {
[1] = nil,
[2] = nil,
[3] = nil,
[4] = nil,
[5] = nil,
[6] = nil,
-- etc.
}
therefore
Code:
for k, v in pairs(frameList) do
does nothing.
I'm pretty sure you will get plenty of errors once the list contains something