added keeping track of last uploaded line in SD if upload fails at any point