fix text editor bug