fixed the empty input in iteration=2 bug