dont make local variables global
Merge pull request #2373 from webzwo0i/avoid-global-vairables

dont make local variables global