Tries to fix deadlock with messages source service and getIndex while sorting.