(intermediate value) is not iterable