fixed a bug with two-way links handling