updating innerHTML in dialogs only when text is supposed to change