fix the gen_id