example for extracting attachments