1)Exit once receive message which status is not 200. 2)Corrected indentations.