Add (working) writing of attributes