fixed issue with weird sorting