Fixed bug (used splice instead of slice) updated to null instead of undefined