fix sort order and search