found the bug for sorting issues, fixes #7458