Fixed the bug related to the closing issue