diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,15 @@
+0.3.0.4
+-------
+<https://github.com/mstksg/ghcjs-websockets/releases/tag/v0.3.0.4>
+
+*   Fixed bug on double mutex acquisition for `connectionClosed`.
+
 0.3.0.3
 -------
 <https://github.com/mstksg/ghcjs-websockets/releases/tag/v0.3.0.3>
 
+**DEPRECATED:** Please use `0.3.0.4`!
+
 *   Added CPP an cabal file flags necessary to enable building on (normal)
     GHC, for hackage and usage with hybrid projects.
 
@@ -9,6 +17,8 @@
 -------
 <https://github.com/mstksg/ghcjs-websockets/releases/tag/v0.3.0.2>
 
+**DEPRECATED:** Please use `0.3.0.4`!
+
 *   Lowered bounds on *text* dependency.
 *   Added `CHANGELOG.md` and `README.md` to extra source dependecy fields, to
     count them in the cabal package.
@@ -17,12 +27,16 @@
 -------
 <https://github.com/mstksg/ghcjs-websockets/releases/tag/v0.3.0.1>
 
+**DEPRECATED:** Please use `0.3.0.4`!
+
 *   Fixed the "other-modules" cabal file field to include non-exported but
     important modules.
 
 0.3.0.0
 -------
 <https://github.com/mstksg/ghcjs-websockets/releases/tag/v0.3.0.0>
+
+**DEPRECATED:** Please use `0.3.0.4`!
 
 *   First official release.  API more or less stabilized.  Library is more or
     less stable, but there are still some extra aspects of the javascript
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -1,6 +1,8 @@
 ghcjs-websockets
 ================
 
+[![Join the chat at https://gitter.im/mstksg/ghcjs-websockets](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mstksg/ghcjs-websockets?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+
 *ghcjs-websockets* aims to provide a clean, idiomatic, efficient, low-level,
 out-of-your-way, bare bones, concurrency-aware interface with minimal
 abstractions over the [Javascript Websockets API][jsapi], inspired by common
diff --git a/ghcjs-websockets.cabal b/ghcjs-websockets.cabal
--- a/ghcjs-websockets.cabal
+++ b/ghcjs-websockets.cabal
@@ -1,5 +1,5 @@
 name:                ghcjs-websockets
-version:             0.3.0.3
+version:             0.3.0.4
 synopsis:            GHCJS interface for the Javascript Websocket API
 description:
                      Documentation online at
diff --git a/src/JavaScript/WebSockets/Internal.hs b/src/JavaScript/WebSockets/Internal.hs
--- a/src/JavaScript/WebSockets/Internal.hs
+++ b/src/JavaScript/WebSockets/Internal.hs
@@ -274,7 +274,7 @@
 _closeConnection :: ConnClosing -> Bool -> Connection -> IO [SocketMsg]
 _closeConnection cclsing dump conn = withConnBlockMasked conn $ do
     closed <- isJust <$> readIORef (_connClosed conn)
-    connState <- connectionStateCode conn
+    connState <- _connectionStateCode conn
     if closed || connState < 3
       then
         return []
@@ -349,7 +349,10 @@
 -- haskelley sum type.
 connectionStateCode :: Connection -> IO Int
 connectionStateCode conn = withConnBlock conn $
-    ws_readyState (_connSocket conn)
+    _connectionStateCode conn
+    
+_connectionStateCode :: Connection -> IO Int
+_connectionStateCode conn = ws_readyState (_connSocket conn)    
 
 -- | Sends the given 'SocketMsg' through the given 'Connection'.
 -- A 'SocketMsg' is a sum type of either 'SocketMsgText t', containing
