fix some bugs in template and action,add default sql data