replaced calls to Array.sort() with AsyncSort.sortImmediately()