fix sorting for sidebar