fixing deprecated startThread