fix sorting when summary.