etcdKey = gateway:retrieveConfig(etcdKeyConfigValue, "");
                    if (etcdKey != "" && gateway:etcdConnectionEstablished) {
                        hasUrlChanged = <boolean>gateway:urlChanged[etcdKey];
                        if(hasUrlChanged is boolean) {
			    reinitRequired = hasUrlChanged;
			} else {
			    log:printError("Error in checking for Re-initialization", err = hasUrlChanged);
			}

                        if (reinitRequired) {

                            destination_attribute = <string>gateway:etcdUrls[etcdKey];
                            var err = trap {{qualifiedServiceName}}_sand.__init(<string>gateway:etcdUrls[etcdKey], config = { {{>http2}}{{>caching}}{{>basicAuth}} });
                            if(err is error) {
				                reinitFailed = true;
                                gateway:urlChanged[etcdKey] = true;

                                http:Response res = new;
                                res.statusCode = 500;
                                json payload = {
                                    "fault": {
                                        "code": "101503",
                                        "message": "Runtime Error",
                                        "description": "Error connecting to the back end"
                                    }
                                };
                                runtime:getInvocationContext().attributes["error_code"] = "101503";
                                res.setPayload(payload);
                                clientResponse = res;
                                log:printError("URL defined at etcd for key " + config:getAsString(etcdKeyConfigValue) + " is invalid");
}

                        }

                    }


                        if (!reinitFailed) {
                        clientResponse = {{qualifiedServiceName}}_sand->forward(urlPostfix, req);
                        runtime:getInvocationContext().attributes["destination"] = destination_attribute;
                    }
