Create unique id with internal counter