fixed more errors in search()