Fixed TextEditor close bug