fixing search bug