Auto-close plugin