Added better proxy support