Added handling of external WM exit signal