diff --git a/classes/connection.py b/classes/connection.py
index 8539d1c..f147a23 100644
--- a/classes/connection.py
+++ b/classes/connection.py
@@ -70,8 +70,8 @@ class Connection:
out += " " * indent + " \n"
out += self.depst().xml(indent + 2, **stationkwargs) + "\n"
out += " " * indent + " \n"
-
- if via and self.via:
+
+ if via and self.via != 0:
out += " " * indent + " \n"
for vst in self.via:
diff --git a/workers/conn.py b/workers/conn.py
index 71a03f4..378ca7e 100644
--- a/workers/conn.py
+++ b/workers/conn.py
@@ -126,11 +126,14 @@ def connRequest(frm, to, count = 3, time = datetime.datetime.now(), mode = False
# ticketurl = det.find("td", { "class": "fares" }).find("a").get("href")
svc = Service(name, depst, depts, arrst, arrts, currdep = curdep, curarr = curarr)
- con = Connection(details)
+ conn = Connection(details)
- con.addService(svc)
+ for vst in via:
+ conn.addVia(vst)
- yield con
+ conn.addService(svc)
+
+ yield conn
def worker(frm, to, count = 3, time = datetime.datetime.now(pytz.timezone("Europe/Vienna")), mode = False, details = False, json = False, via = None):
conns = list(connRequest(getStation(frm), getStation(to), count, time, mode, details, [getStation(vst) for vst in via]))