implemented search with input sort type