 
   toggleSession: (port) ->
     if @bug?
-      return endSession()
+      return @endSession()
 
     atom.workspaceView.prependToBottom(this)
 

    @updateMarkers()
    @childprocess?.kill()
    @bug?.close() # TODO: unregister handlers orelse memory leak!
    @detach()
  
  serialize: ->

    @bug.removeBreakpoint({breakpointId: id})
    @breakpoints = @breakpoints.filter ({breakpointId})->breakpointId isnt id
  toggleBreakpoint: ({scriptPath, lineNumber}, done)->
    toRemove = @breakpoints.filter (bp)->
      (scriptPath is bp.locations[0].scriptPath and
      lineNumber is bp.locations[0].lineNumber)
