fixed bug to return all junctions