fix scope from global to local

Variable `token` declared in global scope `_G`, but used only in local scope.