global var fix