add close event processing