Update tag logic