fix sorting of last 20 entries for min/max calculation