fixed undefines variable name bug