Use the close event