Add client.end() function