fix global variable warning