fix exception handlers