Safer handling of lost context