Updated bug with array splice