The key of time of arrival (TOA) estimation in ultra wideband (UWB) ranging is to detect the first path (FP). In this paper, we propose an optimized FP detector with the adaptive threshold in the absence of prior channel state information (CSI).In particular, the error information (EI) set is introduced to guide the threshold adjustment and determine the TOA estimate with a novel iterative algorithm. The EI set captures the characteristics of major errors regarding the inappropriate threshold. After the iterative process, the proposed scheme is shown to achieve the asymptotic optimal threshold without large number of repeated pulses. Therefore, the proposed scheme efficiently improves the TOA estimation accuracy as compare to the traditional schemes. Simulation results validate the effectiveness and superiority of the proposed scheme.