add replace functionality