correct logic fail in write-tag!