bugfix: don't modify gobal scope.