add replace function.