Q:

Construct dynamic timer with lua

I have created a timer called "timer", but I'm trying to create a function that will arm or disarm timer which is specified in it parameters
timer = sys.timer.create()

function MainTimer(timerName, action, time)
  if action == "arm" then
    timerName:arm(time)
  else 
    timerName:disarm()
  end
end
MainTimer("timer", "arm", 30)

but I'm getting an error from lua saying lua:272: attempt to call method 'arm' (a nil value)
where you think I did a mistake. 
Thank you

A:

Extra quotes :-)  
MainTimer(timer, "arm", 30)

