diff --git a/webssh/static/js/main.js b/webssh/static/js/main.js
index <HASH>..<HASH> 100644
--- a/webssh/static/js/main.js
+++ b/webssh/static/js/main.js
@@ -529,7 +529,7 @@ jQuery(function($){
     };
 
     sock.onclose = function(e) {
-      term.destroy();
+      term.dispose();
       term = undefined;
       sock = undefined;
       reset_wssh();
Fixed term.destroy renamed to dispose.