fix infinite loop caused by empty string in dialog