Add window close event