[FIX] too much recursions problem when working with modal dialogs