remove exception and pass maxIterations correctly