fix disappearing dialog issue.