fixed catch compatibility for newer GHC