prevent default on close click