fix opening and closing links