unify the way to adding to array.fix Issue #1025