added text editor logic