Fixed Issue When Using Dependency Injection