fixed searching bug