fixed issues with Amazon s3 connection