modify threads.py