added total distance to 0 if no totaldistance found