Add mid to output in tag.py