Do not call onerror or onend after onerror has been called.