Fix close handler.