Fix the problem caused by replaceWith by simplely not use it.