Added close event blocking