diff --git a/swarm-bat/src/BatMux.js b/swarm-bat/src/BatMux.js
index <HASH>..<HASH> 100644
--- a/swarm-bat/src/BatMux.js
+++ b/swarm-bat/src/BatMux.js
@@ -169,13 +169,12 @@ BatMux.prototype.drain = function () {
         }
     }
     if (!this.data.length && this.end) {
-        this.onTrunkDataEnd();
+        for(var tag in this.branches) {
+            this.branches[tag].end();
+        }
     }
 };
 
 BatMux.prototype.onTrunkDataEnd = function () {
-    for(var tag in this.branches) {
-        this.branches[tag].end();
-    }
     this.end = true;
 };
fix(bat): emit `end` after all streams' data is sent