fixing search bugs