Changed the exception printing code