Return value for replaceWith is different from handleUrl