sort the directories for the autocomplete dropdown