update patch inject logic