fix double re-display and caret indicator