bug in computing hessian matrix fixed