change comparison so it works in IE8 as well