fix sorting memory limit