do_type functin finished