Use ArrayBuffer instead of Array in mergeMsg