id generation bug