close handler fixed