another attempt to fix the modal closing