Fixed bug caused JS errors in IE8