error due to value of mid changing to last value created by first mergesort