Fix the validation of iteration number