backport fix for injectCallback