implement autothreading for junctions