fix bugs and add tree.k(cgi-script)