fixes in IE8 related to cors checking and json encoding