Chemical treatment for improved performance of reverse osmosis membranes