TypeError: next() takes no keyword arguments