links function fixed