fix bugs with sorting persistence with searches