added lost connection notifier and fix crash during window_destroy