fix undefine bug