diff --git a/Network/Wai/StaticCache.hs b/Network/Wai/StaticCache.hs
--- a/Network/Wai/StaticCache.hs
+++ b/Network/Wai/StaticCache.hs
@@ -1,12 +1,13 @@
 {-# LANGUAGE OverloadedStrings #-}
 {-# LANGUAGE BangPatterns #-}
 module Network.Wai.StaticCache
-(cacheDir, staticfiles)
+(cacheDir, staticfiles, appendCache)
 where
 
 import Data.Conduit 
     -- ( ($$), (=$), runResourceT, ResourceT, ConduitM, awaitForever, yield )
 import Data.Conduit.Combinators (sourceDirectoryDeep)
+import Control.Monad.Trans.Resource (runResourceT, ResourceT)
 import Control.Monad.IO.Class (liftIO)
 import qualified Data.Conduit.List as CL
 import Prelude hiding (FilePath)
@@ -38,22 +39,26 @@
 data FileCache = FC !(Vector Word64) !(V.Vector MetaFile)
                     deriving (Show)
 
--- responseFile :: Status -> ResponseHeaders -> FilePath -> Maybe FilePart -> Response
+appendCache :: FileCache -> FileCache -> FileCache
+appendCache (FC vw1 vm1) (FC vw2 vm2) = FC (vw1 VU.++ vw2) (vm1 V.++ vm2)
 
 cacheDir :: FilePath -> IO FileCache
 cacheDir fp = readDir fp >>= return . buildCache
 
-staticfiles :: FileCache -> Middleware 
-staticfiles fc app req = fromMaybe (app req) response
+staticfiles :: FileCache -> Middleware
+staticfiles fc app req sendResponse = response
     where 
-        response :: Maybe (IO Response)
+        -- response :: IO Response
         response = do 
             let bs = rawPathInfo req
+                -- TODO: can isFolder detect folders that do not end with / ?
                 isFolder = if BSC.null bs then True else (BSC.last bs == '/')
                 reqBS = if isFolder then BSC.append bs "index.html" else bs
-            mf <- getMetaFile fc reqBS
-            let headers = [ ("Content-Type", mime mf), ("ETag", etag mf) ]
-            return . return $ responseFile status200 headers (path mf) Nothing
+            case getMetaFile fc reqBS of
+                Nothing -> app req sendResponse
+                Just mf -> do 
+                    let headers = [ ("Content-Type", mime mf), ("ETag", etag mf) ]
+                    sendResponse $ responseFile status200 headers (path mf) Nothing
 
 getMetaFile :: FileCache -> ByteString -> Maybe MetaFile
 getMetaFile (FC ix m) bs = (V.!) m <$> maybePos
@@ -68,7 +73,6 @@
         ix = VU.generate (V.length metaVec) (\i -> fileId (metaVec V.! i))
 
 readDir :: FilePath -> IO [MetaFile]
--- readDir :: String -> IO [MetaFile]
 readDir f = do 
     l <- runResourceT $ sourceDirectoryDeep False f $$ readIt =$ CL.consume
     runResourceT $ sequence l
diff --git a/wai-static-cache.cabal b/wai-static-cache.cabal
--- a/wai-static-cache.cabal
+++ b/wai-static-cache.cabal
@@ -2,7 +2,7 @@
 -- documentation, see http://haskell.org/cabal/users-guide/
 
 name:                wai-static-cache
-version:             0.1.0.0
+version:             0.1.0.1
 synopsis:            A simple cache for serving static files in a WAI middleware
 -- description:         
 license:             AGPL-3
@@ -19,18 +19,19 @@
   exposed-modules:     Network.Wai.StaticCache
   -- other-modules:       
   -- other-extensions:    
-  build-depends:    base >=4.6 && <4.7
+  build-depends:    base >= 4 && < 5
                ,    cityhash
-               ,    wai
+               ,    wai >= 3.0.1.0
                ,    http-types
                ,    conduit
                ,    conduit-combinators
                ,    vector
                ,    vector-algorithms
-               ,    transformers        == 0.3.0.0
-               ,    system-filepath     == 0.4.9
-               ,    bytestring          == 0.10.0.2
-               ,    text                == 0.11.3.1
-               ,    containers          == 0.5.0.0
+               ,    transformers        
+               ,    system-filepath     
+               ,    bytestring          
+               ,    text                
+               ,    containers          
+               ,    resourcet
   -- hs-source-dirs:      
   default-language:    Haskell2010
