fixed countConnected