BUG FIX: fix problem generating digest when use_preview is true