Fixed dependency injection bug