add flatten for arr