A facile replacement of hydroxyl by halogen with inversion