fixed incorrect reset of exception handler