Return next id