fix exception handler