way to stop py client listening thread