try catch ins close event