fix closing issue