add generateLink method