Possible Fix for 'NoneType' object is not iterable