upgrade exception handling