   done: (error) ->
     @error error if error
 
+    if @nodeInstance.isOrdered() and @nodeInstance.bracketContext[@scope]?.length and @nodeInstance.load is 1
+      # We're doing bracket forwarding. See if there are
+      # dangling closeBrackets in buffer
+      nodeContext = @nodeInstance.bracketContext[@scope]
+      processContext = @result.__bracketContext
+      context = nodeContext[nodeContext.length - 1]
+      buf = @nodeInstance.inPorts[context.source].getBuffer context.ip.scope
+      loop
+        break unless buf.length
+        break unless buf[0].type is 'closeBracket'
+        ip = @nodeInstance.inPorts[context.source].get context.ip.scope
+        ctx = @nodeInstance.bracketContext[ip.scope].pop()
+        ctx.closeIp = ip
+        @result.__bracketClosingAfter = [] unless @result.__bracketClosingAfter
+        @result.__bracketClosingAfter.push ctx
+
     debug "#{@nodeInstance.nodeId} finished processing #{@nodeInstance.load}"
     @nodeInstance.load--
 

    @activated = true

    if @nodeInstance.isOrdered()
      # We're handling packets in order. Set the result as non-resolved so that it can
      # be send when the order comes up
      @result.__resolved = false

  # ## Input preconditions

    ip.scope = @scope if @scope isnt null and ip.scope is null

    if @nodeInstance.isOrdered()
      @result[port] = [] unless port of @result
      @result[port].push ip
      return
    @nodeInstance.outPorts[port].sendIP ip

  # Sends packets for each port as a key in the map
