fix race condition in s3 destination