Fixed bug when searching