bug fix of link direction