fix various caret problem