added config setting for preview_mode (default false)