fix #4 units are sorted incorrectly