Adjusted code related to tag