fix TypeError: Cannot read property 'length' of undefined, because the variable newVal come as undefined