completing search code