text editor bug fixes