Gracefully catching fatal exception