function for tagging with attr