Fix fatal error

fix exception code