bug fix sort order