replace function change