add downloadErroredData function to the window obj