It works when you add more elements than previously. It fails if your new array has 2 elements only while there were 3 before (the third one will be kept)