handleCloseButton fixed.