IE8 cannot access text.style.fontStyle

added a workaround with try / catch