correcting error in thread.c