def add_tag(row, tag_key, capitalize=False):
    """
    Looks up the correct tag based on the row, and appends it to the list of tags
    :param row:
    :param tag_key: the tag key (string of tag) to add
    :param capitalize: True to initial cap the tag key
    :return: the updated row
    """
    if not tag_key:
        return
    if 'tag' not in row:
        row['tag'] = []
    if capitalize:
        tag_key = tag_key.capitalize()
    if tag_key not in row['tag']:
        row['tag'].append(tag_key)
    return row