fix major sort