diff --git a/Concurrent-Cache.cabal b/Concurrent-Cache.cabal
--- a/Concurrent-Cache.cabal
+++ b/Concurrent-Cache.cabal
@@ -2,7 +2,7 @@
 -- documentation, see http://haskell.org/cabal/users-guide/
 
 name:                Concurrent-Cache
-version:             0.1.0.1
+version:             0.1.0.2
 synopsis:            A Cached variable for IO functions.
 description:         This package allows for caching IO functions, either on a
                      timeout or designed to only fetch once.
diff --git a/Control/Concurrent/Cache.hs b/Control/Concurrent/Cache.hs
--- a/Control/Concurrent/Cache.hs
+++ b/Control/Concurrent/Cache.hs
@@ -32,8 +32,8 @@
                                           Just x -> return $ mvar'
         go
       Just value' -> do 
-        when (not $ isNothing thread) $ let Just thread' = thread in killThread thread'
-        modifyMVar_ mvar $ \(_, action', value') -> do
+        modifyMVar_ mvar $ \(thread', action', value') -> do
+          when (not $ isNothing thread') $ let Just thread'' = thread' in killThread thread''
           newThreadId <- forkIO $ do
             threadDelay timeout
             modifyMVar_ mvar $ \(_, action'', _) -> return (Nothing, action'', Nothing)
