added sorting feature in search