Moved unique id creation to where it needs to be created
Add threading