updated sort and search