diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
 Usage
 -----
 
-Cgrep 6.4.7 Usage: cgrep [OPTION] [PATTERN] files...
+Cgrep 6.4.8 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.4.7
+Version:             6.4.8
 Synopsis:            Command line tool
 Homepage:            http://awgn.github.io/cgrep/
 License:             GPL-2
diff --git a/src/Config.hs b/src/Config.hs
--- a/src/Config.hs
+++ b/src/Config.hs
@@ -31,7 +31,7 @@
 cgreprc = "cgreprc"
 
 version :: String
-version = "6.4.7"
+version = "6.4.8"
 
 data Config = Config
               {
diff --git a/src/Main.hs b/src/Main.hs
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -60,22 +60,25 @@
 putRecursiveContents :: Options -> TChan (Maybe FilePath) -> FilePath -> [Lang] -> [String] -> Set.Set FilePath -> IO ()
 putRecursiveContents opts inchan topdir langs prunedir visited = do
     dir <-  doesDirectoryExist topdir
-    if dir then do
+    if dir
+        then do
             names <- liftM (filter (`notElem` [".", ".."])) $ getDirectoryContents topdir
-            forM_ names $ \n -> do
-                let path = topdir </> n
-                let filename = takeFileName path
-                cpath  <- canonicalizePath path
-                status  <- getFileStatus path
-                lstatus <- getSymbolicLinkStatus path
-                unless (cpath `Set.member` visited) $
-                    if isDirectory status && (not (isSymbolicLink lstatus) || deference_recursive opts)
-                       then unless (filename `elem` prunedir)  $
-                           putRecursiveContents opts inchan path langs prunedir (Set.insert cpath visited)
-                       else case getLang opts filename >>= (\f -> f `elemIndex` langs <|> toMaybe 0 (null langs) ) of
-                               Nothing -> return ()
-                               _       -> atomically $ writeTChan inchan (Just path)
-           else atomically $ writeTChan inchan (Just topdir)
+            forM_ names $ \n -> E.catch ( do
+                    let path = topdir </> n
+                    let filename = takeFileName path
+                    cpath  <- canonicalizePath path
+                    status  <- getFileStatus path
+                    lstatus <- getSymbolicLinkStatus path
+                    unless (cpath `Set.member` visited) $
+                        if isDirectory status && (not (isSymbolicLink lstatus) || deference_recursive opts)
+                           then unless (filename `elem` prunedir)  $
+                               putRecursiveContents opts inchan path langs prunedir (Set.insert cpath visited)
+                           else case getLang opts filename >>= (\f -> f `elemIndex` langs <|> toMaybe 0 (null langs) ) of
+                                   Nothing -> return ()
+                                   _       -> atomically $ writeTChan inchan (Just path)
+                )
+                (\e -> let msg = show (e :: SomeException) in hPutStrLn stderr ("cgrep: " ++ msg))
+        else atomically $ writeTChan inchan (Just topdir)
 
 
 -- read patterns from file
