Fixed error for uploading to Amazon S3