avoid global variable