Added condition to stop reading for further response when a final response has been sent.