fix iteritems issue for Python 3

Don't know if there is a better fix for having iterator of items to work on both Python 2 and 3, this is what I come up with.