Add better sorting in dialogs