thread and main updated