fix sort order issues