added beforeUpdate lifecycle callback to tag and tag entity