add boxNum counter
refactor box counter