handling device disconnect while tests are running