Changing the connection determination logic so it will not error on a fresh connection.