bug in upload if data invalidated

Upload process fails now if data is invalidated. Started after adding
the battery power stream.