Changed triggering of sorting due to performance reasons