disconnect works when waiting for connection