Add closeEvent option