put file open in s3 call in a block