fixed changeSelectionTo to account for HTML entities