CMD: clean buf when cmd done