added file upload retrying if uploading file fails