add loop upcount for debug