Fix the regression for the preview function
Merge pull request #1836 from Randy-Ma/master

Fix the regression for the preview function