Fixed closing issue