modify loop count