Fixed double-search bug