Revised exception handling