change gloabal variable to non-gloabal