add a check to see if link is null