Fix bug with multiple addresses to connect to