Fixed bug when dealing with specific case like s3.amazonaws.com