properly implement xhr.upload events