fix stateful error that turned function arguments into global bindings