Amended the archive function.