excepting another error in linkgen function