fix Exception handling.