Modified exception handling