avoid recursive invocation of caret merging procedure

(cherry picked from commit f2bcf5d21d7d417efaf75bfa2d8dde8ea9040b0a)