implement recursive inject