bug fix in changing the source/target of links in the alignment