update to more advanced modal helper functions