Fixed bug with mergeArray