Fix bug in IE8+