Solved exception and moved service initialization to factory.