Enduro recording drop out after around 100miles

During a long distance ultra I was gutted when my enduro just stopped recording at around the 100 mile point. Up till then it was actively recording my data. It was still tracking my route, but I had to restart the activity. It then stayed on for the remaining 145miles, but all the data was lost for the first portion. Any idea how I prevent this happening?