Fixed to work with latest aws-sdk

Current version doesn't work with latest aws-sdk. This pull request fix the issue. This fix should be also backward compatible.