more error checks to avoid thinking failed file status check as inexistent file, and add retry for file upload