fix self not defined bug