Yes, that works, the problem is that sorting happens after the first N items have been selected alphabetically.
Put it differentely, the top 10 elements of the table should not change if I choose to display 100 or 1000 elements - the top 10 are always the top 10. However I don't observe this behavior - the top 10 elements will be different depending on how many total elements I choose to display.