I did give the frame a name, this is how i declared all the frames:
Lua Code:
local frame, events = CreateFrame("Frame", "frame", UIParent), {}
local name, realm = nil
local anchor = CreateFrame("Frame", "anchor", UIParent)
local icons = CreateFrame("Frame", "icons", anchor)
local cd = CreateFrame("Cooldown", "cd", icons)
Maybe giving it the same name as the local variable name is a problem.
I will try changing the code a bit when I get home from vacation.
I'll keep you updated when I do, thanks for all the help!