added if statement in link rendering