added special handling for Exception and subclasses