Error handler added for hessian inversion failure