Fixed a minor bug in searching