better documentation and attachment saving that actually works