write id attribute to self