Fixing bug I introduced for saving the attachments