add a replacement function