added code for raw attachments