handle sorting in previewstore