obvious global variable fix