fixed small cursor placement bug on undo