Fix the bug that the program could not recover after the user press the left up close button.