diff --git a/chat-example/chat.go b/chat-example/chat.go
index 6b23a8a135af082e931f70e9f9da749898a45a34..e6e355d04688bd37f7c2495a5483c794d4453a55 100644
--- a/chat-example/chat.go
+++ b/chat-example/chat.go
@@ -27,6 +27,7 @@ func (cs *chatServer) subscribeHandler(w http.ResponseWriter, r *http.Request) {
 		log.Print(err)
 		return
 	}
+	defer c.Close(websocket.StatusInternalError, "")
 
 	err = cs.subscribe(r.Context(), c)
 	if errors.Is(err, context.Canceled) {
diff --git a/chat-example/index.html b/chat-example/index.html
index e2383a42496d3024ab25be5fa3e689a5b6c571fe..76ae8370149c2415bfd4925bacc9b886b3b89710 100644
--- a/chat-example/index.html
+++ b/chat-example/index.html
@@ -16,7 +16,7 @@
       <div id="publish-form-container">
         <form id="publish-form">
           <input name="message" id="message-input" type="text" />
-          <input value="Submit" type="submit"/>
+          <input value="Submit" type="submit" />
         </form>
       </div>
     </div>