To avoid duplicates in loop metadata, if the string to add is already there, just update the value.
LGTM