fixes js error in search