fix searching bug