wip, need to remove printouts.
realizing that one needs to save the doc before put_attachment, ugh