Changed logic for chunked uploader loop.