add replace in buffer