fix sorting in cms