add max iteration number