Not connecting by deviceID issue

Was not connecting to device by port Id because this line could never be
true