Fixed search and add sorting