How do you know that it does not save data? You declare an array inside the trigger. So this is not global, but local. Every time a trigger is triggered, you get a new array. You add one item, display its counter and release it again. The score is 1 , so it works.
Your code works fine, although it's useless. :) What did you mean? No waiting, the account belongs to another array. You put an element in a local array and show the counter of another (global?) Array. No wonder this will not work. I think you are modifying the wrong array.
source share