Simple lua script failing (set servo chanel at arm)

I have simple script to change servo output to camera to start recording, but script fails to start…

function update()
local armed = arming:is_armed()
if armed then
SRV_Channels:set_output_pwm(94, 2000)
else
SRV_Channels:set_output_pwm(94, 1001)
end
return update, 2000
end

return update()

Any idea why?

Look early in the messages tab for the full error when it first happend.