updated, thread.c doesn't work