fixed a bug that causes crash after HF fails to converge