stop thread when remove