fix search code