replace client.shutdown with close