fix threading, add data trained