there is a bug in linkCost