added counter to generate id
merged