fix counter initialization