Added code to flush the network connection.