Added check for proxy before calling ProxyFilter.setAgent