Fixed syntax error in toggle_preview