fix the bilateral linking logic