You are iterating a dict here:
dict
for target in targets:
so target will be the key, not a dict item.
target