attach tag and remove tag