[improv] add few error handling + clean some function in ext_dom + handle bool type