Water quality control system