add modal dialogs logic