Fix fails in uploads after fall and rise of network connection