Fixed bug in text editor