fix undefied bug