Fixed ID Generator Algorithm Issue