maybe a check of the readystate here? or at least a comment asserting what the readystate should be? This was confusing enough that it should be documented.