ID generation fix