deep clone array inside withSort helper, in case the origin data is affected