fixes of dependencies injection, added onKernel() function