fixes in search helper class, thanks @craigh