increase compatibility of link.sh