fix minor sorting bug