changed merging script