fixing array merge issue