Fix to have unique ids in graph