logic error to create xhr object in IE