Added new option to replace attachments