Add res_init and res_search