Fixed crash in IE6, IE7 and IE8