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

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