Updated to put a logic around http_proxy setting