Fix thread to continue runing main thread