fixed closing issue