fix tpt.selectedl sometimes being incorrect