added generate_id()