fix bug in link formatting