I declared a global variable, and when I use it in a function, although the value I assigned to it remains within the function, the moment I try to use the variable outside