Exception handling improvement