The effects of water residence time on the biological quality in a distribution network