fix not-closing issue