Connectivity is a crucial quality of service measure in wireless sensor networks. However, the network is always at risk of being split into several disconnected components owing to sensor failures caused by various factors. To handle the connectivity problem, this paper introduces an in-advance mechanism to prevent network partitioning in the initial deployment phase. The approach is implemented in a distributed manner, and every node only needs to know local information of its 1-hop neighbors, which makes the approach scalable to large networks. In the proposed mechanism, the critical nodes are locally detected by a critical node detection algorithm (CND) based on the concept of maximal simplicial complex, and backups are arranged to tolerate their failures. The choice of parameters used in the algorithm is also discussed in detail. Finally, we demonstrate the effectiveness of the proposed algorithm through simulation experiments.