You didn't mention how you are adding the elements into the array. Posting a screenshot of the events will help and show what is wrong and what you are expecting to happen.
I add like the picture.
you can see the array image below.
For example, if I add a new value, it is added at the top and its value becomes 0. I want the new value added to be below the value of "MustafaKaya". but he adds up. so he adds to 0.