Fixed #2151 determine whether to array

See #2151