fix issue with cursor misalignment.