fix undefined variable that breaks Closure (closes #819)