Fixing search bug