updated threading usage