Adjusted exception handling