Added check for variable exists in event tpl