Fix bug: After close windows process still running 2 (if connect was unsuccessful)