convert local variable in global