Fix error in s3 code