fixed text editing bugs