rewrite inject method