move connection outside devices loop