global variable fix