Updated to look for the specific instance of the HTML file. Also added null check when trying to add a LineMark.