private synchronized void loadCredentials() {
if (!needsToLoadCredentials()) return;
try {
lastInstanceProfileCheck = new Date();
String credentialsResponse = new EC2MetadataClient()
.getDefaultCredentials();
JSONObject jsonObject = new JSONObject(credentialsResponse);
if (jsonObject.has("Token")) {
credentials = new BasicSessionCredentials(