modified some more things so it runs ok on IE8