fix array merging