bug fix for text editing