Adding key sorting to the joined array.