diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@
 Usage
 -----
 
-Cgrep 6.6.24. Usage: cgrep [OPTION] [PATTERN] files...
+Cgrep 6.6.25. Usage: cgrep [OPTION] [PATTERN] files...
 
 cgrep [OPTIONS] [ITEM]
 
diff --git a/cgrep.cabal b/cgrep.cabal
--- a/cgrep.cabal
+++ b/cgrep.cabal
@@ -1,6 +1,6 @@
 Name:                cgrep
 Description:         Cgrep: a context-aware grep for source codes
-Version:             6.6.24
+Version:             6.6.25
 Synopsis:            Command line tool
 Homepage:            http://awgn.github.io/cgrep/
 License:             GPL-2
@@ -10,7 +10,6 @@
 Category:            Utils
 Build-type:          Simple 
 Stability:           Experimental
-Build-type:          Simple
 Extra-source-files:  README.md
 Cabal-version:       >=1.10
 
@@ -77,6 +76,7 @@
                        transformers,
                        process,
                        aeson,
-                       yaml
+                       yaml,
+                       exceptions
   Ghc-options:         -O2 -Wall -threaded -rtsopts -with-rtsopts=-N
   Default-language:    Haskell2010
diff --git a/src/CGrep/CGrep.hs b/src/CGrep/CGrep.hs
--- a/src/CGrep/CGrep.hs
+++ b/src/CGrep/CGrep.hs
@@ -30,7 +30,11 @@
 import qualified CGrep.Strategy.Generic.Semantic as Semantic
 
 import Control.Monad.Trans.Reader
+import Control.Monad.Catch
+import Control.Monad.IO.Class
 
+import System.IO
+
 import CGrep.Lang
 import CGrep.Common
 import CGrep.Output
@@ -39,6 +43,7 @@
 import Data.Maybe
 import Options
 import Reader
+import Config
 
 hasLanguage :: FilePath -> Options -> [Lang] -> Bool
 hasLanguage path opt xs = isJust $ getFileLang opt path >>= (`elemIndex` xs)
@@ -73,14 +78,22 @@
 isRegexp :: Options -> Bool
 isRegexp opt = regex_posix opt || regex_pcre opt
 
-runCgrep :: FilePath -> [Text8] -> OptionT IO [Output]
-runCgrep filename patterns = do
-    opt <- reader snd
-    case () of
-        _ | (not . isRegexp) opt && not (hasTokenizerOpt opt) && not (semantic opt) && edit_dist opt -> Levenshtein.search filename patterns
-          | (not . isRegexp) opt && not (hasTokenizerOpt opt) && not (semantic opt)                  -> BoyerMoore.search filename patterns
-          | (not . isRegexp) opt && semantic opt && hasLanguage filename opt [C,Cpp]                 -> CppSemantic.search filename patterns
-          | (not . isRegexp) opt && semantic opt                                                     -> Semantic.search filename patterns
-          | (not . isRegexp) opt                                                                     -> CppTokenizer.search filename patterns
-          | isRegexp opt                                                                             -> Regex.search filename patterns
-          | otherwise                                                                                -> undefined
+runCgrep :: Config -> Options -> FilePath -> [Text8] -> OptionT IO [Output]
+runCgrep conf opts filename patterns =
+    catch ( do
+        opt <- reader snd
+        case () of
+            _ | (not . isRegexp) opt && not (hasTokenizerOpt opt) && not (semantic opt) && edit_dist opt -> Levenshtein.search filename patterns
+              | (not . isRegexp) opt && not (hasTokenizerOpt opt) && not (semantic opt)                  -> BoyerMoore.search filename patterns
+              | (not . isRegexp) opt && semantic opt && hasLanguage filename opt [C,Cpp]                 -> CppSemantic.search filename patterns
+              | (not . isRegexp) opt && semantic opt                                                     -> Semantic.search filename patterns
+              | (not . isRegexp) opt                                                                     -> CppTokenizer.search filename patterns
+              | isRegexp opt                                                                             -> Regex.search filename patterns
+              | otherwise                                                                                -> undefined
+    )
+    (\e -> let msg = show (e :: SomeException) in
+        liftIO $ do
+            hPutStrLn stderr $ showFileName conf opts filename ++ ": exception: " ++ takeN 80 msg
+            return [ ]
+    )
+
diff --git a/src/CGrep/Common.hs b/src/CGrep/Common.hs
--- a/src/CGrep/Common.hs
+++ b/src/CGrep/Common.hs
@@ -24,7 +24,8 @@
                     , expandMultiline
                     , ignoreCase
                     , trim
-                    , trim8) where
+                    , trim8
+                    , takeN) where
 
 import qualified Data.ByteString.Char8 as C
 import qualified Data.ByteString.Search as SC
@@ -37,6 +38,11 @@
 import Options
 import Reader
 import Util
+
+
+takeN :: Int -> String -> String
+takeN n xs | length xs > n = take n xs ++ "..."
+          | otherwise     = xs
 
 
 trim :: String -> String
diff --git a/src/Main.hs b/src/Main.hs
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -138,22 +138,23 @@
     in_chan  <- liftIO newTChanIO
     out_chan <- liftIO newTChanIO
 
+
     -- launch worker threads...
 
     forM_ [1 .. jobs opts] $ \_ -> liftIO . forkIO $
         void $ runExceptT . forever $ do
             fs <- lift $ atomically $ readTChan in_chan
-            lift $ E.catch (case fs of
-                    [] -> atomically $ writeTChan out_chan []
-                    xs -> void $ (if asynch opts then flip mapConcurrently
-                                                 else forM) xs $ \x -> do
-                            out <- fmap (take (max_count opts)) (runReaderT (runCgrep x patterns) (conf,sanitizeOptions x opts))
-                            unless (null out) $ atomically $ writeTChan out_chan out)
-                   (\e -> let msg = show (e :: SomeException) in
-                        hPutStrLn stderr (showFileName conf opts (getTargetName (head fs))
-                            ++ ": exception: " ++ if length msg > 80
-                                                    then take 80 msg ++ "..."
-                                                    else msg))
+            lift $
+                E.catch (
+                    case fs of
+                        [] -> atomically $ writeTChan out_chan []
+                        xs -> void $ (if asynch opts then flip mapConcurrently
+                                                     else forM) xs $ \x -> do
+                                out <- fmap (take (max_count opts)) (runReaderT (runCgrep conf opts x patterns) (conf, sanitizeOptions x opts))
+                                unless (null out) $ atomically $ writeTChan out_chan out)
+                       (\e -> let msg = show (e :: SomeException) in
+                            hPutStrLn stderr (showFileName conf opts (getTargetName (head fs))
+                                ++ ": exception: " ++ takeN 80 msg))
             when (null fs) $ throwE ()
 
 
