Updated to work when not using a proxy. Fixed errant use of variable name 'uri' to 'url'.