fixed texteditor javascript