fixed third level sorting.