fix a bug when rendering links