fixed custcount main