fix [0] call with undefiend