when is the thread stopped ? shouldn't it be running with daemon=True ?