fix injection function