Fixing injection and adding logging