A mechanistic study of halogen interaction with polyamide reverse-osmosis membranes