fixed nonetype not iterable