Added locking for archive