fix id generation