Implemented attachments logic.