add length counter