Fix an undefined var issue