working on text editor mode. input is working unproperly