togglePreview for preview