fix a fragment replacement data-losing bug