change convergence test in optimization