trimed the text from dialog