leave xnest when ws closed