The energy in wireless sensor networks is a restrictive resource which primarily affects the life of nodes. Many routing protocols use clustering mechanism to optimize the network lifetime. A problem can occur if the allocation of cluster members is not uniformly distributed. In case of LEACH protocol there are great differences in cluster sizes. Consequently, the energy load of such network becomes disproportional which brings to faster dying of cluster heads that have more members. This paper discusses a novel approach to LEACH algorithm that takes into consideration the number of existing members in each cluster. The proposed algorithm significantly prolongs the period before the first node dies, hence providing better reliability of the clustering process. The results of simulations also revealed considerably less variations of cluster sizes, which is crucial for energy load to be spread more equally.