only close a client if succesfully opened a connection