Added upload checks to make sure data is uploaded only when needed.