preview_mode fix undefined check
Merge branch 'preview_mode'