fix issue with typeahead sorting