bugfix for break out of upload loop after two failures