fixing bugs with modals