kill session on window close