undefined var fix