support replace function