fix sortIndex
Merge pull request #339 from mimmi20/issue-333-2

Issue 333 2. Try