Emitting close event properly now.