updated archiveMetadata method to mitigate memory issue with large
archives