changed the way modals open/close