Fixed error caused by wrong dependency injection