#18 fix unstable sorting