Add fix for IE8 'html is undefined' error

IE8 throws a console eror 'html is undefined' and this pull request adds in a catch for that to define it.