fix a bug that when creating new tag file,  was written into it.