fix close modals bug