PMO-2838 improved state handling for uploads.