fix synchronize thread when detecting