bugfixes for dependency injection