Make closeModalOnClick work correctly 2