fix global namespace pollution from undeclared local variable