It might be helpful if you can post or at least tell, how you’re assigning value to the array, my guess is that instead of adding elements you’re assigning a value which will override the previous value (losing previous elements only the last time you assign value will remain)