add sort to the ruby array to stop the continual changing of the aggregation rules