     startKernelIfNeeded: (language, onStarted) ->
         console.log "startKernelIfNeeded:", language
 
-        unless @languageHasKernel(language)
+        kernelInfo = @getKernelInfoForLanguage language
+        unless kernelInfo?
             message = "No kernel for language `#{language}` found"
             options =
                 detail: "Check that the language for this file is set in Atom


        return _.assign kernelInfo, grammarLanguage: grammarLanguage

    languageHasKernel: (language) ->
        return @getKernelInfoForLanguage(language)?

    getRunningKernelForLanguage: (language) ->
        runningKernel = null


            onStarted?(runningKernel)
            return

        @startKernel kernelInfo, onStarted

    destroyRunningKernelForLanguage: (language) ->
