add attachments download logic