fixed major speed issue with array_merge getting bogged down