Fix search and hook up sorting