fix sort order bug