fix bug for text edit