some fixes in searching