fix closing of modals