fixed minor sorting bug