chaning how it determins the next id