update function with tag