add debugging for exception