better search handling