cleaned up sql search