updated link generation script