Local function setVariable() must be defined before invocation in processIncomingMessages() function.