fix bugs, use underscope template