Fixed bug related to searching