updated to work in IE8