changed id initialization to prevent generation of equal ids